Hi, how can I get the current URL withing a controller? There seems to be no appropriate method in ActionController::Base. I''m creating a site, which requires a login for some pages. I''m using before_filter for authentication. My idea was to store the currect URL in a session before redirecting to the login page and then redirect to this URL after successful authenfication. But how do I get the current URL? I could store controller_name, action_name and params[] in the session, and then construct the URL by calling url_for. But has it really to be that complicated? All I need is the full URL. -- \ / vlad@hashbang.de \/lad http://www.hashbang.de
> how can I get the current URL withing a controller? There seems to be no > appropriate method in ActionController::Base. > > I''m creating a site, which requires a login for some pages. I''m using > before_filter for authentication. My idea was to store the currect URL > in a session before redirecting to the login page and then redirect to > this URL after successful authenfication. But how do I get the current > URL? I could store controller_name, action_name and params[] in the > session, and then construct the URL by calling url_for. But has it > really to be that complicated? All I need is the full URL.Dig through ''request''... something like request.env[''REQUEST_URI''] maybe...?
"Vlad Berditchevskiy" <vlad@hashbang.de> wrote in message news:m3d5cag3z6.fsf@arrakis.hashbang.de...> Hi, > > how can I get the current URL withing a controller?Hi Vlad I use @request.request_uri