Rails - how can I capture the URL that directed to the current action in my app?
Posted
by sa125
on Stack Overflow
See other posts from Stack Overflow
or by sa125
Published on 2010-05-10T12:37:27Z
Indexed on
2010/05/10
12:44 UTC
Read the original article
Hit count: 348
Hi -
I need to see what page a request came from in my controller so I could be able to redirect back to it. For example, if I'm on a page showing a specific product (say /products/1
) and it has a link to its vendor (/vendors/12
), I want to be able to detect inside the vendors_controller that I came to that page from /products/1
. Is there a simple way in Rails to achieve this, so that I could access it via params or session? thanks.
© Stack Overflow or respective owner