From c4717a74cbdfb21afe7438a28661ab0a56f9aaae Mon Sep 17 00:00:00 2001 From: Guillaume Date: Sat, 22 Nov 2014 23:07:30 +0100 Subject: [PATCH] Update 18n sample to translate default --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 7211607..edb472d 100644 --- a/README.md +++ b/README.md @@ -366,8 +366,7 @@ class ApplicationController < ActionController::Base def user_not_authorized(exception) policy_name = exception.policy.class.to_s.underscore - flash[:error] = I18n.t "pundit.#{policy_name}.#{exception.query}", - default: 'You cannot perform this action.' + flash[:error] = t "#{policy_name}.#{exception.query}", scope: "pundit", default: :default redirect_to(request.referrer || root_path) end end @@ -376,6 +375,7 @@ end ```yaml en: pundit: + default: 'You cannot perform this action.' post_policy: update?: 'You cannot edit this post!' create?: 'You cannot create posts!'