Add docs for id_param option of load_resource

Added in https://github.com/ryanb/cancan/pull/425 but lacked documentation
This commit is contained in:
Ben Moss 2013-02-20 10:03:46 -05:00
parent 38d4654523
commit 9f7f520fa7

View File

@ -96,6 +96,11 @@ module CanCan
# #
# load_resource :find_by => :permalink # will use find_by_permalink!(params[:id]) # load_resource :find_by => :permalink # will use find_by_permalink!(params[:id])
# #
# [:+id_param+]
# Find using a param key other than :id. For example:
#
# load_resource :id_key => :url # will use find(params[:url])
#
# [:+collection+] # [:+collection+]
# Specify which actions are resource collection actions in addition to :+index+. This # Specify which actions are resource collection actions in addition to :+index+. This
# is usually not necessary because it will try to guess depending on if the id param is present. # is usually not necessary because it will try to guess depending on if the id param is present.