Rails: Extracting the raw url from the request

Posted by pankajbhageria on Stack Overflow See other posts from Stack Overflow or by pankajbhageria
Published on 2010-04-16T06:35:52Z Indexed on 2010/04/16 6:43 UTC
Read the original article Hit count: 297

Filed under:

I am working with Rails 2.2.

The required behaviour is as follows:

I have a link(with a ajax link embedded)

xyz.com/admin#page1

When I go to the above page, I should be redirected to the login page, if I am not logged in.

After I log in, I should be taken back to

xyz.com/admin#page1

For this I need to store the url in session when I visit any page.

The problem is that when I do request.uri, I get xyz.com/admin

But I want to store xyz.com/admin#page1

Regards, Pankaj

© Stack Overflow or respective owner

Related posts about ruby-on-rails