# Putting params back into link\_to

**URL:** <https://www.ruby-forum.com/t/putting-params-back-into-link-to/105339>\
**Category:** Rails\
**Created:** [May 29, 2007, 1:45am UTC](https://www.ruby-forum.com/t/putting-params-back-into-link-to/105339 "2007-05-29T01:45:01Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Chad](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/ecccb3/32.png) [@Chad](https://www.ruby-forum.com/u/Chad)\
**Post date:** [May 29, 2007, 1:45am UTC](https://www.ruby-forum.com/t/putting-params-back-into-link-to/105339/1 "2007-05-29T01:45:01Z")

</div>

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

Example.

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 🙂

---

<div class="post-metadata">

**Author:** ![Chad](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/ecccb3/32.png) [@Chad](https://www.ruby-forum.com/u/Chad)\
**Post date:** [May 29, 2007, 4:39am UTC](https://www.ruby-forum.com/t/putting-params-back-into-link-to/105339/2 "2007-05-29T04:39:42Z")

</div>

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.
