Sha256: 1463daa8798f6158b33967e06f6e6fd11a3460c6c836f5bafc9e77c1e7714484

Contents?: true

Size: 1.11 KB

Versions: 15

Compression:

Stored size: 1.11 KB

Contents

module Vedeu

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

    include Vedeu::Controller

    # @param params [Hash] The named parameters provided to the controller which
    #   will be used by the actions within the controller.
    # @return [Vedeu::ApplicationController]
    def initialize(**params)
      @params = params
    end

    # @param controller [Symbol] The name of controller to be redirected to.
    # @param action [Symbol] The name of the action within the controller to be
    #   called.
    # @param params [Hash] Any named parameter which need to be passed to the
    #   action.
    def redirect_to(controller, action, **params)
      Vedeu.trigger(:_goto_, controller, action, params)
    end
    alias_method :redirect, :redirect_to
    alias_method :goto, :redirect_to

    protected

    # @!attribute [rw] params
    # @return [Hash] The named parameters passed to the controller.
    attr_accessor :params

  end # ApplicationController

end # Vedeu

Version data entries

15 entries across 15 versions & 1 rubygems

Version Path
vedeu-0.6.4 lib/vedeu/application/application_controller.rb
vedeu-0.6.3 lib/vedeu/application/application_controller.rb
vedeu-0.6.2 lib/vedeu/application/application_controller.rb
vedeu-0.6.1 lib/vedeu/application/application_controller.rb
vedeu-0.6.0 lib/vedeu/application/application_controller.rb
vedeu-0.5.13 lib/vedeu/application/application_controller.rb
vedeu-0.5.12 lib/vedeu/application/application_controller.rb
vedeu-0.5.11 lib/vedeu/application/application_controller.rb
vedeu-0.5.10 lib/vedeu/application/application_controller.rb
vedeu-0.5.9 lib/vedeu/application/application_controller.rb
vedeu-0.5.8 lib/vedeu/application/application_controller.rb
vedeu-0.5.7 lib/vedeu/application/application_controller.rb
vedeu-0.5.6 lib/vedeu/application/application_controller.rb
vedeu-0.5.5 lib/vedeu/application/application_controller.rb
vedeu-0.5.4 lib/vedeu/application/application_controller.rb