Putting params back into link_to

I’ve read quite a few examples of how to do this, like
http://railsenvy.com/2007/2/18/merging-params 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 :slight_smile:

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 forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs