Skip to content

Instantly share code, notes, and snippets.

@adgilfillan
Created November 28, 2012 18:41
Show Gist options
  • Save adgilfillan/4163134 to your computer and use it in GitHub Desktop.
Save adgilfillan/4163134 to your computer and use it in GitHub Desktop.
app controller
class ApplicationController < ActionController::Base
protect_from_forgery
before_filter :authenticate, :except => [:login, :notify_member]
def authenticate
if session[:member_id].nil?
flash[:alert] = 'You need to login first.'
redirect_to :controller => 'admin', :action => 'login'
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment