Class: Rad::Processors::ControllerCaller
- Inherits:
-
Rad::Processor
- Object
- Rad::Processor
- Rad::Processors::ControllerCaller
- Defined in:
- lib/rad/controller/processors/controller_caller.rb
Instance Attribute Summary
Attributes inherited from Rad::Processor
Instance Method Summary collapse
Methods inherited from Rad::Processor
Constructor Details
This class inherits a constructor from Rad::Processor
Instance Method Details
#call ⇒ Object
4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 |
# File 'lib/rad/controller/processors/controller_caller.rb', line 4 def call # prepare response = workspace.response.must_be.defined klass = workspace.class.must_be.present raise "The controller class #{klass} must be a Rad::AbstractController!" unless klass.is? Rad::AbstractController controller = workspace.controller = klass.new action = workspace.action = workspace.method_name format = workspace.params.format # call workspace.content = catch :halt_render do controller.run_callbacks :action, method: action do # call controller controller.send action # render view controller.render action: action end end end |