Topic: devise with current_user method

I use devise, i need to set another cookie when a user login!
With nifty, i have changed control_authentication.rb to had current_company = @company .....

but with devise, how i can do that? i just want to get a current_company attached to user as a current_user global method.


Re: devise with current_user method

Ok, i i'm now able to set up my current_company with helper.

but now, when a user log, check to subdomain attached to the company linked to the user. i would like to redirect it to his subdomain.

someone told me to do that with routes.rb, but i'm not sure to understand that. Because the subdomain isn't linked with the user.
i have read something about

def after_sign_in_path_for(resource)
    stored_location_for(resource) || welcome_path

i'm not sure what this def do? after_sign_in_path_for  need to be called somewhere?
thanks .