Can the 'Back' browser functionality be invoked from a Rails 'Back' link?
+5
A:
Use
<%= link_to 'Back', :back %>
This is specificied in the RDoc here
This generates some Javascript to navigate backward. I've just tested it, and it works.
Tilendor
2009-03-07 00:17:03
It doesn't work 'exactly' like a Back button. All the inputted form data is cleared.
alamodey
2009-03-07 01:04:25
A:
You can use link_to("Hello", :back) to generate <a href="javascript:history.back()">Hello</a>
.
cpm
2009-03-07 00:27:33