Skip to content

Loading…

Change language of exceptions/permissions #614

Closed
passalini opened this Issue · 2 comments

2 participants

@passalini

I need to change language of permissions/exceptions, I was wondering if there is a way to change as we change the language of a rails app.

@fillman
 # You can also use I18n to customize the message. Action aliases defined in Ability work here.
    #
    #   en:
    #     unauthorized:
    #       manage:
    #         all: "Not authorized to %{action} %{subject}."
    #         user: "Not allowed to manage other user accounts."
    #       update:
    #         project: "Not allowed to update this project."

Is that what you're lookin' for?
Source: https://github.com/ryanb/cancan/blob/master/lib/cancan/controller_additions.rb#L305

@passalini

exactly!!! Thanks and sorrry, I should have looked better documentation.

@passalini passalini closed this
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.