Sha256: c9478f78bc5a96ff2b557557cea20b61717c6d390133b0b60c35d3f540adf0f5

Contents?: true

Size: 766 Bytes

Versions: 12

Compression:

Stored size: 766 Bytes

Contents

rad.controller

class ControllerCaller < Rad::Conveyors::Processor
  def call                
    # prepare
    response = workspace.response.must_be.defined
    klass = workspace.class.must_be.present
    raise "The controller class #{klass} must be a Rad::Controller::Abstract!" unless klass.is? Rad::Controller::Abstract
    controller = workspace.controller = klass.new                  
    action = workspace.action = workspace.method_name
    format = workspace.params.format

    # call
    
    workspace.content = catch :halt do
      controller.run_callbacks :action, method: action do          
        # call controller
        controller.send action

        # render view
        controller.render action: action
      end
    end
  end          

end

Version data entries

12 entries across 12 versions & 1 rubygems

Version Path
rad_core-0.0.25 lib/rad/controller/processors/controller_caller.rb
rad_core-0.0.24 lib/rad/controller/processors/controller_caller.rb
rad_core-0.0.23 lib/rad/controller/processors/controller_caller.rb
rad_core-0.0.22 lib/rad/controller/processors/controller_caller.rb
rad_core-0.0.21 lib/rad/controller/processors/controller_caller.rb
rad_core-0.0.20 lib/rad/controller/processors/controller_caller.rb
rad_core-0.0.19 lib/rad/controller/processors/controller_caller.rb
rad_core-0.0.18 lib/rad/controller/processors/controller_caller.rb
rad_core-0.0.17 lib/rad/controller/processors/controller_caller.rb
rad_core-0.0.16 lib/rad/controller/processors/controller_caller.rb
rad_core-0.0.15 lib/rad/controller/processors/controller_caller.rb
rad_core-0.0.14 lib/rad/controller/processors/controller_caller.rb