From ba287964c34341c7bec96b6d1a1d71c59abea3d2 Mon Sep 17 00:00:00 2001 From: Linus Marton Date: Fri, 11 May 2018 15:17:35 +0200 Subject: [PATCH] Expand example in readme showing how to use policy_scopes Closes: #514 --- README.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/README.md b/README.md index f1e9746..a09e224 100644 --- a/README.md +++ b/README.md @@ -265,6 +265,10 @@ You can now use this class from your controller via the `policy_scope` method: def index @posts = policy_scope(Post) 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