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.



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

def initialize
  super
  @trusty_config = TrustyCms::Config
end

Instance Attribute Details

#cacheObject

Returns the value of attribute cache.



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

def cache
  @cache
end

#pagination_parametersObject (readonly)

Returns the value of attribute pagination_parameters.



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

def pagination_parameters
  @pagination_parameters
end

#trusty_configObject

Returns the value of attribute trusty_config.



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

def trusty_config
  @trusty_config
end

Instance Method Details

#after_sign_in_path_for(_resource) ⇒ Object



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

def (_resource)
  admin_pages_path
end

#template_nameObject



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

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