Class: Netzke::Base

Inherits:
Object
  • Object
show all
Includes:
CanCan::ControllerAdditions
Defined in:
lib/netzke/cancan.rb

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.helper_method(*args) ⇒ Object

cancan calls helper_method, which is present in any controller, but not in a netzke component



16
17
18
# File 'lib/netzke/cancan.rb', line 16

def self.helper_method(*args)
  # We don't do anything since there is no view layer in netzke components
end

Instance Method Details

#current_abilityAbility

This method returns the current ability with the current user from the controller.

Returns:

  • (Ability)


8
9
10
# File 'lib/netzke/cancan.rb', line 8

def current_ability
  @current_ability ||= Ability.new(Netzke::Base.controller.current_user)
end