oo00oo
2006-Jan-17 13:29 UTC
[Rails] link_to or helper to generate a javascript:history.back() ?
Hello, There is an link_to option or an helper that generate a link like : <a href="javascript:history.back()">Back</a> Thanks
Raghuraman Suraj
2006-Jan-17 13:33 UTC
[Rails] link_to or helper to generate a javascript:history.back() ?
you can use link_to "Back", "javascript:histroy.back()" On Tue, 2006-01-17 at 14:30 +0100, oo00oo wrote:> Hello, > > There is an link_to option or an helper that generate a link like : > > <a href="javascript:history.back()">Back</a> > > Thanks > > > _______________________________________________ > Rails mailing list > Rails@lists.rubyonrails.org > http://lists.rubyonrails.org/mailman/listinfo/rails >
Alex Young
2006-Jan-17 13:34 UTC
[Rails] link_to or helper to generate a javascript:history.back() ?
oo00oo wrote:> Hello, > > There is an link_to option or an helper that generate a link like : > > <a href="javascript:history.back()">Back</a><%= link_to_function ''Back'', ''history.back()'' %> Should do the trick... -- Alex
oo00oo
2006-Jan-17 13:54 UTC
[Rails] link_to or helper to generate a javascript:history.back() ?
Ok thanks, so no helper or option like :back => true :)
Guest
2006-Jan-17 18:54 UTC
[Rails] Re: link_to or helper to generate a javascript:history.back(
oo00oo wrote:> Ok thanks, so no helper or option like :back => true > :)Or you can add this to your ApplicationHelper.rb def link_back return link_to_function ''Back'', ''history.back()'' end Then in your views: <%= link_to_back %> -- Posted via http://www.ruby-forum.com/.
Kevin Olbrich
2006-Jan-17 21:20 UTC
[Rails] Re: link_to or helper to generate a javascript:history.back(
Guest wrote:> oo00oo wrote: >> Ok thanks, so no helper or option like :back => true >> :) > > Or you can add this to your ApplicationHelper.rb > > def link_back > return link_to_function ''Back'', ''history.back()'' > end > > Then in your views: > <%= link_to_back %>You can also use ''redirect_to :back'' which will send you back to the referring page... not quite the same thing. _Kevin -- Posted via http://www.ruby-forum.com/.
Guest
2006-Jan-18 01:05 UTC
[Rails] Re: link_to or helper to generate a javascript:history.back(
Guest wrote:> oo00oo wrote: >> Ok thanks, so no helper or option like :back => true >> :) > > Or you can add this to your ApplicationHelper.rb > > def link_back > return link_to_function ''Back'', ''history.back()'' > end > > Then in your views: > <%= link_to_back %>you mean <%= link_back %> -- Posted via http://www.ruby-forum.com/.