mirror of
https://github.com/varvet/pundit.git
synced 2022-11-09 12:30:11 -05:00
parent
d17265277c
commit
ba287964c3
1 changed files with 4 additions and 0 deletions
|
@ -265,6 +265,10 @@ You can now use this class from your controller via the `policy_scope` method:
|
||||||
def index
|
def index
|
||||||
@posts = policy_scope(Post)
|
@posts = policy_scope(Post)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def show
|
||||||
|
@post = policy_scope(Post).find(params[:id])
|
||||||
|
end
|
||||||
```
|
```
|
||||||
|
|
||||||
Just as with your policy, this will automatically infer that you want to use
|
Just as with your policy, this will automatically infer that you want to use
|
||||||
|
|
Loading…
Reference in a new issue