Guest User

Untitled

a guest
May 27th, 2018
87
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.33 KB | None | 0 0
  1. ## controller
  2. before_filter :authorize
  3. ## application.rb
  4. # Redirects to "login" => "login" if user is not logged in
  5. def authorize
  6. unless session[:user_id]
  7. flash[:notice] = "Please log in"
  8. session[:jumpto] = request.parameters
  9. redirect_to(:controller => "login", :action => "login")
  10. end
  11. end
Add Comment
Please, Sign In to add comment