Method: CanCan::ControllerAdditions::ClassMethods#load_and_authorize_resource
- Defined in:
- lib/cancan/controller_additions.rb
#load_and_authorize_resource(*args) ⇒ Object
Sets up a before filter which loads and authorizes the current resource. This performs both load_resource and authorize_resource and accepts the same arguments. See those methods for details.
class BooksController < ApplicationController
end
14 15 16 |
# File 'lib/cancan/controller_additions.rb', line 14 def (*args) cancan_resource_class.add_before_filter(self, :load_and_authorize_resource, *args) end |