[Rails] How to get the current URL?

Vlad Berditchevskiy
2006-07-12T16:57:42Z

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