From a47f989459597dcdef53e7b91f32be1be836e349 Mon Sep 17 00:00:00 2001 From: 0llirocks <4518617+0llirocks@users.noreply.github.com> Date: Thu, 23 May 2024 17:07:18 +0200 Subject: [PATCH] Add documentation for id_param to authorize_resource (#836) Currently the id_param is not documented for authorize_resource. This commit adds the documentation. --- lib/cancan/controller_additions.rb | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/lib/cancan/controller_additions.rb b/lib/cancan/controller_additions.rb index 0c84f83e..a51f5b96 100644 --- a/lib/cancan/controller_additions.rb +++ b/lib/cancan/controller_additions.rb @@ -171,6 +171,11 @@ def load_resource(*args) # [:+instance_name+] # The name of the instance variable for this resource. # + # [:+id_param+] + # Find using a param key other than :id. For example: + # + # load_resource :id_param => :url # will use find(params[:url]) + # # [:+through+] # Authorize conditions on this parent resource when instance isn't available. #