Module: FocusedController::Mixin

Extended by:
ActiveSupport::Concern
Defined in:
lib/focused_controller/mixin.rb

Defined Under Namespace

Modules: ClassMethods

Instance Method Summary collapse

Instance Method Details

#_prefixesObject



47
48
49
# File 'lib/focused_controller/mixin.rb', line 47

def _prefixes
  super.dup.unshift(self.class.focused_controller_path)
end

#action_nameObject



51
52
53
# File 'lib/focused_controller/mixin.rb', line 51

def action_name
  self.class.name.demodulize.underscore
end

#callObject



67
68
# File 'lib/focused_controller/mixin.rb', line 67

def call
end

#method_for_action(name) ⇒ Object



55
56
57
# File 'lib/focused_controller/mixin.rb', line 55

def method_for_action(name)
  FocusedController.action_name
end

#view_assignsObject



59
60
61
62
63
64
65
# File 'lib/focused_controller/mixin.rb', line 59

def view_assigns
  if self.class.allow_view_assigns
    super
  else
    {}
  end
end