Advertisement
saasbook

before_filter_login_example.rb

Feb 20th, 2012
166
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Ruby 0.34 KB | None | 0 0
  1. class UsersController < ApplicationController
  2.   before_filter :logged_in?, :except => [:login, :process_login]
  3.   private # subsequent methods are private to this class, until 'public' given
  4.   def logged_in?
  5.     redirect_to login_path and return unless
  6.       (@current_user = get_logged_in_user)
  7.   end
  8.   public
  9.   # ...controller actions go here
  10. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement