Sha256: c8fa935da534063b7843636b14d35129c939455575dfa8c7e08e91ca7534ea7c

Contents?: true

Size: 590 Bytes

Versions: 3

Compression:

Stored size: 590 Bytes

Contents

#---
# Excerpted from "Agile Web Development with Rails, 2nd Ed."
# We make no guarantees that this code is fit for any purpose. 
# Visit http://www.pragmaticprogrammer.com/titles/rails2 for more book information.
#---
class ApplicationController < ActionController::Base

  # Pick a unique cookie name to distinguish our session data from others'
  session :session_key => '_depot_session_id'

  private

  def authorize
    unless User.find_by_id(session[:user_id])
      flash[:notice] = "Please log in"
      redirect_to(:controller => "login", :action => "login")
    end
  end
  
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
amrita2-2.0.0 sample/depot/app/controllers/application.rb
amrita2-2.0.1 sample/depot/app/controllers/application.rb
amrita2-2.0.2 sample/depot/app/controllers/application.rb