adding documentation for passing additional arguments to can?

This commit is contained in:
Ryan Bates 2010-04-15 11:28:58 -07:00
parent 69f7a65914
commit 510cf509ee

View File

@ -26,6 +26,15 @@ module CanCan
#
# can? :create, Project
#
# Any additional arguments will be passed into the "can" block definition. This
# can be used to pass more information about the user's request for example.
#
# can? :create, Project, request.remote_ip
#
# can :create Project do |project, remote_ip|
# # ...
# end
#
# Not only can you use the can? method in the controller and view (see ControllerAdditions),
# but you can also call it directly on an ability instance.
#