Class: Vedeu::ApplicationController

Inherits:
Object
  • Object
show all
Includes:
Controller
Defined in:
lib/vedeu/application/application_controller.rb

Overview

Provides methods which should be available to all client application controllers. The client application’s ApplicationController will inherit from this class.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(**params) ⇒ Vedeu::ApplicationController

Returns a new instance of Vedeu::ApplicationController.

Parameters:

  • params (Hash)

    The named parameters provided to the controller which will be used by the actions within the controller.



19
20
21
# File 'lib/vedeu/application/application_controller.rb', line 19

def initialize(**params)
  @params = params
end

Instance Attribute Details

#paramsHash (protected)

Returns The named parameters passed to the controller.

Returns:

  • (Hash)

    The named parameters passed to the controller.



39
40
41
# File 'lib/vedeu/application/application_controller.rb', line 39

def params
  @params
end

Instance Method Details

#redirect_to(controller, action, **params) ⇒ Object Also known as: redirect, goto

Parameters:

  • controller (Symbol)

    The name of controller to be redirected to.

  • action (Symbol)

    The name of the action within the controller to be called.

  • params (Hash)

    Any named parameter which need to be passed to the action.



29
30
31
# File 'lib/vedeu/application/application_controller.rb', line 29

def redirect_to(controller, action, **params)
  Vedeu.trigger(:_goto_, controller, action, params)
end