E
E
eldar_web2015-12-26 15:34:07
Ruby on Rails
eldar_web, 2015-12-26 15:34:07

How can you find out from which url a person came from in Ruby on Rails?

I want to put the "Back" button in the view, and write the address of the previous url in the link.
How can it be solved?
Learned to use request.referer. But what to do in this case?
Let's say if a person came from /page1 to /page2, then request.referer will show /page1, but if the page is updated in /page2, then an error occurs or, in theory, the path will be /page2. How can this problem be solved?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Anton Radushevsky, 2015-12-26
@eldar_web

in the controller you can get request.referer

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question