class ApplicationController < ActionController::Base before_filter :check_authentication, :except => [:login] before_filter :find_items def find_items @categories = Category.find(:all) end def check_authentication if params[:controller]["admin"] unless session[:user] redirect_to :controller => 'users', :action => 'login' end end end end