Rails 3, browser functionality

I am trying to get a feedback function working on an Iphone web application.

I looked through all the other posts about this issue, but none of them relate to my specific case.

This is my sequence of actions;

main page โ†’ event page (click username) โ†’ face page

Right now I have <% = link_to 'Back' ,: back%> on both the event page and the user page. With this implementation, when I click on a page with a person, it brings me to the events page, as expected. But when I click on the button from the events page, it returns to the user page, because this is the page from which I came. (Whereas the expected functionality and functionality using the back button of the browser should have taken me to the home page) ..

Can someone help me get this functionality in Rails?

+3
source share
1 answer

In the rails the documentation for the methodlink_to you can read:

(...) : referrer - JavaScript

, url_for method:

when :back
  controller.request.env["HTTP_REFERER"] || 'javascript:history.back()'
else

. @Zepplock, , , javascript:history.back(), , "" .

+11

Source: https://habr.com/ru/post/1794632/


All Articles