Sha256: 215ec0311707aeb6302036c8a6038eb0c10346a253c443fd323cd13c042ec3ca
Contents?: true
Size: 851 Bytes
Versions: 111
Compression:
Stored size: 851 Bytes
Contents
# 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 # Pick a unique cookie name to distinguish our session data from others' session :session_key => '_rails_root_session_id' def ensure_logged_in unless session[:logged_in] respond_to do |accepts| accepts.html do flash[:error] = 'What do you think you\'re doing?' redirect_to '/' end accepts.xml do headers["Status"] = "Unauthorized" headers["WWW-Authenticate"] = %(Basic realm="Web Password") render :text => "Couldn't authenticate you", :status => '401 Unauthorized' end end return false end return true end end
Version data entries
111 entries across 111 versions & 23 rubygems