Class: ApplicationController
- Includes:
- LoginSystem, Radiant::LegacyRoutes
- Defined in:
- app/controllers/application_controller.rb
Direct Known Subclasses
Admin::ExportController, 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.
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.
17 18 19 20 |
# File 'app/controllers/application_controller.rb', line 17 def initialize super @config = Radiant::Config end |
Instance Attribute Details
#cache ⇒ Object
Returns the value of attribute cache.
15 16 17 |
# File 'app/controllers/application_controller.rb', line 15 def cache @cache end |
#config ⇒ Object
Returns the value of attribute config.
15 16 17 |
# File 'app/controllers/application_controller.rb', line 15 def config @config end |
Instance Method Details
#include_javascript(script) ⇒ Object
29 30 31 |
# File 'app/controllers/application_controller.rb', line 29 def include_javascript(script) @javascripts << script end |
#include_stylesheet(sheet) ⇒ Object
25 26 27 |
# File 'app/controllers/application_controller.rb', line 25 def include_stylesheet(sheet) @stylesheets << sheet end |
#rescue_action_in_public(exception) ⇒ Object
50 51 52 53 54 55 56 57 |
# File 'app/controllers/application_controller.rb', line 50 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
33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 |
# File 'app/controllers/application_controller.rb', line 33 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 |