mirror of
https://github.com/varvet/pundit.git
synced 2022-11-09 12:30:11 -05:00
Add Readme note on restarting Rails server
after generating application policy. Fixes #51.
This commit is contained in:
parent
a5c52cd6b8
commit
d16022d316
1 changed files with 4 additions and 1 deletions
|
@ -29,6 +29,9 @@ with some useful defaults for you:
|
|||
rails g pundit:install
|
||||
```
|
||||
|
||||
After generating your application policy, restart the Rails server so that Rails
|
||||
can pick up any classes in the new `app/policies/` directory.
|
||||
|
||||
## Policies
|
||||
|
||||
Pundit is focused around the notion of policy classes. We suggest that you put
|
||||
|
@ -265,7 +268,7 @@ class ApplicationPolicy
|
|||
end
|
||||
```
|
||||
|
||||
## Rescuing a denied Authorization in rails
|
||||
## Rescuing a denied Authorization in Rails
|
||||
|
||||
Pundit raises a `Pundit::NotAuthorizedError` you can [rescue_from](http://guides.rubyonrails.org/action_controller_overview.html#rescue_from) in your `ApplicationController`. You can customize the `user_not_authorized` method in every controller.
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue