photomix/app/controllers/application_controller.rb
2009-05-22 14:13:46 +02:00

21 lines
587 B
Ruby

# Filters added to this controller apply to all controllers in the application.
# Likewise, all the methods added will be available for all controllers.
class ApplicationController < ActionController::Base
helper :all # include all helpers, all the time
protect_from_forgery # See ActionController::RequestForgeryProtection for details
# Scrub sensitive parameters from your log
# filter_parameter_logging :password
protected
def set_current_person
@current_user = session[:user]
end
def login_required
redirect_to(login_path) unless @current_user
end
end