Charles Churchill
2007-Jun-29 23:09 UTC
acts_as_authenticated, reset_session, and redirect_back_or_default
Just a question and an FYI I just installed rails and acts_as_authenticated and was setting up a site. Everything works fine except that in the AccountController that I generated the calls to the routine redirect_back_or_default don''t work because the call just before it to reset_session clears the session[:return_to] that the method uses to set where it will redirect. I ended up adding a version of redirect_back_or_default to the account controller that works for me (and as a benefit it keeps me from having to set session[:return_to] which stunk) def redirect_back_or_default(default) if request.env["HTTP_REFERER"].nil? redirect_to default else redirect_to(request.env["HTTP_REFERER"]) # same as redirect_to :back end end My question is, am I just missing something, is there a different version of code out there, or is this thing really broken. Anyway, thanks, Charles Churchill --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---