1
0
Fork 0
mirror of https://github.com/varvet/pundit.git synced 2022-11-09 12:30:11 -05:00

Include Pundit module in controller examples

* In order for the `verify_authorized` and `verify_policy_scoped`
  methods to be defined in your controllers, you must `include Pundit`.
  This is stated early in the documentation, but it's not clear in these
  particular examples that it's needed.
This commit is contained in:
Jay Hayes 2016-02-01 10:06:39 -06:00 committed by Jay Hayes
parent 93500247a7
commit ecb505b114

View file

@ -283,6 +283,7 @@ forgotten to authorize the action. For example:
``` ruby
class ApplicationController < ActionController::Base
include Pundit
after_action :verify_authorized
end
```
@ -295,6 +296,7 @@ authorize individual instances.
``` ruby
class ApplicationController < ActionController::Base
include Pundit
after_action :verify_authorized, except: :index
after_action :verify_policy_scoped, only: :index
end