Skip to content

Commit a47f989

Browse files
authored
Add documentation for id_param to authorize_resource (#836)
Currently the id_param is not documented for authorize_resource. This commit adds the documentation.
1 parent 0cdbba7 commit a47f989

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

lib/cancan/controller_additions.rb

+5
Original file line numberDiff line numberDiff line change
@@ -171,6 +171,11 @@ def load_resource(*args)
171171
# [:+instance_name+]
172172
# The name of the instance variable for this resource.
173173
#
174+
# [:+id_param+]
175+
# Find using a param key other than :id. For example:
176+
#
177+
# load_resource :id_param => :url # will use find(params[:url])
178+
#
174179
# [:+through+]
175180
# Authorize conditions on this parent resource when instance isn't available.
176181
#

0 commit comments

Comments
 (0)