Method: CanCan::ControllerAdditions::ClassMethods#skip_load_and_authorize_resource
- Defined in:
- lib/cancan/controller_additions.rb
#skip_load_and_authorize_resource(*args) ⇒ Object
Skip both the loading and authorization behavior of CanCan for this given controller. This is primarily useful to skip the behavior of a superclass. You can pass :only and :except options to specify which actions to skip the effects on. It will apply to all actions by default.
class ProjectsController < SomeOtherController
:only => :index
end
You can also pass the resource name as the first argument to skip that resource.
192 193 194 195 |
# File 'lib/cancan/controller_additions.rb', line 192 def (*args) skip_load_resource(*args) (*args) end |