Quantcast
Channel: User easement - Stack Overflow
Viewing all articles
Browse latest Browse all 45

How to redirect to previous page in Ruby On Rails?

$
0
0

I have a page that lists all of the projects that has sortable headers and pagination.

path:/projects?order=asc&page=3&sort=code

I choose to edit one of the projects

path:projects/436/edit

When I click save on that page, it calls the projects controller / update method. After I update the code I want to redirect to the path that I was on before I clicked edit a specific project. In other words, I want to be on the same page with the same sorting.

I saw link_to(:back) and thought that :back may work in redirect_to(:back), but that's a no go.

puts YAML::dump(:back) yields the following::back 

How can I get this to work?


Viewing all articles
Browse latest Browse all 45

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>