# Passing parameter by link\_to

**URL:** <https://www.ruby-forum.com/t/passing-parameter-by-link-to/108157>\
**Category:** Rails\
**Created:** [June 29, 2007, 2:46pm UTC](https://www.ruby-forum.com/t/passing-parameter-by-link-to/108157 "2007-06-29T14:46:43Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![incoroneta](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/i/a3d4f5/32.png) [@incoroneta](https://www.ruby-forum.com/u/incoroneta)\
**Post date:** [June 29, 2007, 2:46pm UTC](https://www.ruby-forum.com/t/passing-parameter-by-link-to/108157/1 "2007-06-29T14:46:43Z")

</div>

Hi i’ve to pass the variable user.user\_id by the function link\_to to the  
action show.  
the code is:

\<%= link\_to 'Show', :action =\> 'show', :id =\> user.user\_id %\>

inside the action show the value of “id” is totally different from the  
value contained in user.user\_id

Maybe is only a stupid error.  
Can anybody help me???

---

<div class="post-metadata">

**Author:** ![incoroneta](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/i/a3d4f5/32.png) [@incoroneta](https://www.ruby-forum.com/u/incoroneta)\
**Post date:** [June 29, 2007, 2:54pm UTC](https://www.ruby-forum.com/t/passing-parameter-by-link-to/108157/2 "2007-06-29T14:54:27Z")

</div>

I cant see anything wrong with your code. can you post the action you  
use ?

On 29 Jun., 14:46, incoroneta [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)

---

<div class="post-metadata">

**Author:** ![incoroneta](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/i/a3d4f5/32.png) [@incoroneta](https://www.ruby-forum.com/u/incoroneta)\
**Post date:** [June 29, 2007, 4:11pm UTC](https://www.ruby-forum.com/t/passing-parameter-by-link-to/108157/3 "2007-06-29T16:11:14Z")

</div>

sorry that problem is solved…

i’ve found that the problem occurs when i try to read the results of  
find() function, and i’ve added another post.

[http://www.ruby-forum.com/topic/113614#265391](http://www.ruby-forum.com/topic/113614#265391)

thanks
