Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ## controller
- before_filter :authorize
- ## application.rb
- # Redirects to "login" => "login" if user is not logged in
- def authorize
- unless session[:user_id]
- flash[:notice] = "Please log in"
- session[:jumpto] = request.parameters
- redirect_to(:controller => "login", :action => "login")
- end
- end
Add Comment
Please, Sign In to add comment