Advertisement
saasbook

before_filter_login_example.rb

Jan 10th, 2012
315
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 :set_current_user, :except => [:login, :process_login]
  3.   private # subsequent methods are private to this class, until 'public' given
  4.   def is_logged_in?
  5.     redirect_to login_path and return unless (@current_user = get_logged_in_user)
  6.   end
  7.   public
  8.   # ...controller actions go here
  9. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement