Permalink
Browse files

adding documentation for passing additional arguments to can?

  • Loading branch information...
1 parent 69f7a65 commit 510cf509ee9f635e430aba9c727b2bf1afe676bb @ryanb committed Apr 15, 2010
Showing with 9 additions and 0 deletions.
  1. +9 −0 lib/cancan/ability.rb
View
@@ -26,6 +26,15 @@ module Ability
#
# 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.
#

0 comments on commit 510cf50

Please sign in to comment.