Module: Permitted::ActionController

Defined in:
lib/permitted/action_controller.rb

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.included(controller) ⇒ Object



3
4
5
# File 'lib/permitted/action_controller.rb', line 3

def self.included(controller)
  controller.delegate :permit!, :permitted_to?, :to => :current_ability
end

Instance Method Details

#current_abilityObject



7
8
9
# File 'lib/permitted/action_controller.rb', line 7

def current_ability
  @current_ability ||= Permitted::Ability.new(current_user)
end