Module: Motorhead::ActionController

Defined in:
lib/motorhead/abstract_controller.rb

Instance Method Summary collapse

Instance Method Details

#process_action(method_name, *args) ⇒ Object



49
50
51
52
53
54
55
56
57
58
# File 'lib/motorhead/abstract_controller.rb', line 49

def process_action(method_name, *args)
  if self.is_a?(Motorhead::Controller) && method(method_name).super_method
    headers['X-Cascade'] = 'pass'
    if self.class.parent::Engine.active?(self)
      super
    end
  else
    super
  end
end

#redirect_to(options = {}, response_status = {}) ⇒ Object

:doc:



75
76
77
78
79
# File 'lib/motorhead/abstract_controller.rb', line 75

def redirect_to(options = {}, response_status = {}) #:doc:
  ret = super
  request.env['motorhead_render_result'] = response
  ret
end

#render_to_body(options = {}) ⇒ Object



68
69
70
71
72
73
# File 'lib/motorhead/abstract_controller.rb', line 68

def render_to_body(options = {})
  return if (headers['X-Cascade'] == 'pass') && !defined?(@_motorhead_action_successfully_finished)
  ret = super
  request.env['motorhead_render_result'] = response
  ret
end

#view_assignsObject



60
61
62
63
64
65
66
# File 'lib/motorhead/abstract_controller.rb', line 60

def view_assigns
  if request.env.key? 'motorhead_view_assigns'
    super.merge request.env['motorhead_view_assigns']
  else
    super
  end
end