misiek
1/18/2006 10:45:00 PM
I think that before_filter is like sessions with PHP
but I have no ideas ho to use it.
I need
I know that I need to put that to ...
class ApplicationController < ActionController::Base
before_filter :super_user_session
def super_user_session
@id = @params['id']
@super_id = @params['super_id']
end
end
so I am going to
def sign_in
@user = User.find(:first, :conditions => "login = '" +
@params['user']['login'] + "' and passwd = '" +
@params['user']['passwd'] + "'")
redirect_to(:controller => "application", :action =>
"super_user_session", :id => @user, :super_id => @user)
end
from sign_in to super_user_session to set up the variables
but what now ???