Class: ApplicationController
- Includes:
- LoginSystem
- Defined in:
- app/controllers/application_controller.rb
Direct Known Subclasses
Admin::ConfigurationController, Admin::ExtensionsController, Admin::PreferencesController, Admin::ReferencesController, Admin::ResourceController, Admin::WelcomeController, SiteController
Instance Attribute Summary collapse
-
#cache ⇒ Object
Returns the value of attribute cache.
-
#config ⇒ Object
Returns the value of attribute config.
-
#pagination_parameters ⇒ Object
readonly
Returns the value of attribute pagination_parameters.
Instance Method Summary collapse
- #include_javascript(script) ⇒ Object
- #include_stylesheet(sheet) ⇒ Object
-
#initialize ⇒ ApplicationController
constructor
A new instance of ApplicationController.
- #rescue_action_in_public(exception) ⇒ Object
- #template_name ⇒ Object
Methods included from LoginSystem
Constructor Details
#initialize ⇒ ApplicationController
Returns a new instance of ApplicationController.
21 22 23 24 |
# File 'app/controllers/application_controller.rb', line 21 def initialize super @config = Radiant::Config end |
Instance Attribute Details
#cache ⇒ Object
Returns the value of attribute cache.
17 18 19 |
# File 'app/controllers/application_controller.rb', line 17 def cache @cache end |
#config ⇒ Object
Returns the value of attribute config.
17 18 19 |
# File 'app/controllers/application_controller.rb', line 17 def config @config end |
#pagination_parameters ⇒ Object (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 |
Instance Method Details
#include_javascript(script) ⇒ Object
33 34 35 |
# File 'app/controllers/application_controller.rb', line 33 def include_javascript(script) @javascripts << script end |
#include_stylesheet(sheet) ⇒ Object
29 30 31 |
# File 'app/controllers/application_controller.rb', line 29 def include_stylesheet(sheet) @stylesheets << sheet end |
#rescue_action_in_public(exception) ⇒ Object
54 55 56 57 58 59 60 61 |
# File 'app/controllers/application_controller.rb', line 54 def rescue_action_in_public(exception) case exception when ActiveRecord::RecordNotFound, ActionController::UnknownController, ActionController::UnknownAction, ActionController::RoutingError render :template => "site/not_found", :status => 404 else super end end |
#template_name ⇒ Object
37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 |
# File 'app/controllers/application_controller.rb', line 37 def template_name case self.action_name when 'index' 'index' when 'new','create' 'new' when 'show' 'show' when 'edit', 'update' 'edit' when 'remove', 'destroy' 'remove' else self.action_name end end |