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

Update README.md

This commit is contained in:
Justin Gordon 2015-09-17 20:10:04 -10:00
parent 24036a5225
commit c6e131e50e

View file

@ -133,6 +133,7 @@ end
If you don't have an instance for the first argument to `authorize`, then you can pass
the class. For example:
Policy:
```ruby
class PostPolicy < ApplicationPolicy
def admin_list?
@ -141,6 +142,7 @@ class PostPolicy < ApplicationPolicy
end
```
Controller:
```ruby
def admin_list
authorize Post # we don't have a particular post to authorize