Class ApplicationController
In: app/controllers/application.rb
Parent: ActionController::Base

Application-wide functionality used by controllers.

Also establishes Cart, LineItem, and User as models. This is necessary because these classes appear in sessions, and hence have to be preloaded

Methods

Private Instance methods

The authorize method is used as a before_hook in controllers that contain administration actions. If the session does not contain a valid user, the method redirects to the LoginController.login.

[Source]

    # File app/controllers/application.rb, line 27
27:   def authorize                            #:doc:
28:     unless session[:user]
29:       flash[:notice] = "Please log in"
30:       redirect_to(:controller => "login", :action => "login")
31:     end
32:   end

Set the notice if a parameter is given, then redirect back to the current controller’s index action

[Source]

    # File app/controllers/application.rb, line 18
18:   def redirect_to_index(msg = nil)         #:doc:
19:     flash[:notice] = msg if msg
20:     redirect_to(:action => 'index')
21:   end

[Validate]