Class: ApplicationController

Inherits:
ActionController::Base
  • Object
show all
Includes:
LoginSystem
Defined in:
app/controllers/application_controller.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from LoginSystem

included

Constructor Details

#initializeApplicationController

Returns a new instance of ApplicationController.



20
21
22
23
# File 'app/controllers/application_controller.rb', line 20

def initialize
  super
  @trusty_config = TrustyCms::Config
end

Instance Attribute Details

#cacheObject

Returns the value of attribute cache.



16
17
18
# File 'app/controllers/application_controller.rb', line 16

def cache
  @cache
end

#pagination_parametersObject (readonly)

Returns the value of attribute pagination_parameters.



17
18
19
# File 'app/controllers/application_controller.rb', line 17

def pagination_parameters
  @pagination_parameters
end

#trusty_configObject

Returns the value of attribute trusty_config.



16
17
18
# File 'app/controllers/application_controller.rb', line 16

def trusty_config
  @trusty_config
end

Instance Method Details

#after_sign_in_path_for(_resource) ⇒ Object



25
26
27
# File 'app/controllers/application_controller.rb', line 25

def (_resource)
  admin_pages_path
end

#template_nameObject



29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
# File 'app/controllers/application_controller.rb', line 29

def template_name
  case action_name
  when 'index'
    'index'
  when 'new', 'create'
    'new'
  when 'show'
    'show'
  when 'edit', 'update'
    'edit'
  when 'remove', 'destroy'
    'remove'
  else
    action_name
  end
end