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

Expand example in readme showing how to use policy_scopes

Closes: #514
This commit is contained in:
Linus Marton 2018-05-11 15:17:35 +02:00
parent d17265277c
commit ba287964c3
No known key found for this signature in database
GPG key ID: 3AE26AD3E41F5ED8

View file

@ -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