adding documentation for passing additional arguments to can?
This commit is contained in:
parent
69f7a65914
commit
510cf509ee
|
@ -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.
|
||||
#
|
||||
|
|
Loading…
Reference in New Issue
Block a user