From 510cf509ee9f635e430aba9c727b2bf1afe676bb Mon Sep 17 00:00:00 2001 From: Ryan Bates Date: Thu, 15 Apr 2010 11:28:58 -0700 Subject: [PATCH] adding documentation for passing additional arguments to can? --- lib/cancan/ability.rb | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/lib/cancan/ability.rb b/lib/cancan/ability.rb index b3ffa09..9c7504c 100644 --- a/lib/cancan/ability.rb +++ b/lib/cancan/ability.rb @@ -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. #