# Link\_to that sends multi-level params

**URL:** <https://www.ruby-forum.com/t/link-to-that-sends-multi-level-params/127039>\
**Category:** Rails\
**Created:** [January 24, 2008, 2:43pm UTC](https://www.ruby-forum.com/t/link-to-that-sends-multi-level-params/127039 "2008-01-24T14:43:10Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![jfoxny](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/a6a055/32.png) [@jfoxny](https://www.ruby-forum.com/u/jfoxny)\
**Post date:** [January 24, 2008, 2:43pm UTC](https://www.ruby-forum.com/t/link-to-that-sends-multi-level-params/127039/1 "2008-01-24T14:43:10Z")

</div>

How can I use a link\_to that will send multi-level params? I need to be  
able to use the following in the controller:

params[:sales\_order][:id]

Here’s the link\_to I currently have:

link\_to sales\_order.id.to\_s, :action =\> ‘show’, :id =\> sales\_order.id

But that just gives me this in the controller:

params[:id]

Is it possible to do what I’m wanting?

Thanks!

---

<div class="post-metadata">

**Author:** ![jfoxny](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/a6a055/32.png) [@jfoxny](https://www.ruby-forum.com/u/jfoxny)\
**Post date:** [January 24, 2008, 3:27pm UTC](https://www.ruby-forum.com/t/link-to-that-sends-multi-level-params/127039/2 "2008-01-24T15:27:38Z")

</div>

Allright, I think I figured out how to do this. Maybe it can help  
someone else:

link\_to sales\_order.id.to\_s, :action =\> ‘show’, :sales\_order =\> {:id  
=\> sales\_order.id}
