Forum: Ruby on Rails putting params back into link_to

Announcement (2017-05-07): is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see and for other Rails- und Ruby-related community platforms.
39b797fbc3c082a2c745df0739230897?d=identicon&s=25 Chad (Guest)
on 2007-05-29 01:45
I've read quite a few examples of how to do this, like and it works fine so long
as I use string variables in my link do you have any clue how to keep a
hash in the link?


My search form has several search options, sort by's, checkboxes, etc.
Using a get request does something like,
/search?q=foo&option[sort]=price&option[perpage]=10 .... etc.

However, if I try to put the params back into a link it get stringified
and ends up: /search?q=foo&options=sortpriceperpage10&page=2

Trying to wrap my head around this one, any clues would be much
appreciated :)
53a1f0aba6f0489d49f5e6fc3df323fa?d=identicon&s=25 Robert James (robertjames)
on 2007-05-29 04:39
(Received via mailing list)
AFAIK, this is a serious shortcoming of link_to.  You need to add them
manually to the string.  Google for some helpers to do this for you.
This topic is locked and can not be replied to.