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:
parent
24036a5225
commit
c6e131e50e
1 changed files with 2 additions and 0 deletions
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue