# Does id have special meaning?

**URL:** <https://www.ruby-forum.com/t/does-id-have-special-meaning/129496>\
**Category:** Rails\
**Created:** [February 19, 2008, 2:57am UTC](https://www.ruby-forum.com/t/does-id-have-special-meaning/129496 "2008-02-19T02:57:28Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![hei](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/h/779978/32.png) [@hei](https://www.ruby-forum.com/u/hei)\
**Post date:** [February 19, 2008, 2:57am UTC](https://www.ruby-forum.com/t/does-id-have-special-meaning/129496/1 "2008-02-19T02:57:28Z")

</div>

I want to make four links with different arguments but the same  
action.  
The first time, I did it like this:  
\<%= link\_to ‘xx’ {:action =\> xx, :id =\> 0} %\>  
\<%= link\_to ‘xx’ {:action =\> xx, :id =\> 1} %\>  
\<%= link\_to ‘xx’ {:action =\> xx, :id =\> 2} %\>  
\<%= link\_to ‘xx’ {:action =\> xx} %\>  
yes, I want the forth link with no argument.  
But it didn’t work. when current url is xx/1, then the forth link  
bring me to xx/1 , xx/2, xx/0 as the same.  
I solve it by changing the argument name, something like  
\<%= link\_to ‘xx’ {:action =\> xx, :ids =\> 0} %\>  
then the url looks like xx?ids=0  
everything works  
Can anyone tells me more details about it ? or just where can I find  
the answer.  
Thanks a lot!

---

<div class="post-metadata">

**Author:** ![hei](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/h/779978/32.png) [@hei](https://www.ruby-forum.com/u/hei)\
**Post date:** [February 19, 2008, 3:21am UTC](https://www.ruby-forum.com/t/does-id-have-special-meaning/129496/2 "2008-02-19T03:21:27Z")

</div>

Yeah you are right, i have the same event like yours.

The forth link " \<%= link\_to ‘xx’ {:action =\> xx} %\> " should have the  
same meaning with " \<%= link\_to ‘xx’ {:action =\> xx, :id =\> 0} %\> ", In  
this case I usually put additional params like you have done too "\<%=  
link\_to ‘xx’ {:action =\> xx, :ids =\> 0} %\> ", I have no idea how it  
could be like that.

Please check, are you using render in your controller to show  
destination link?

Because your link is [http://localhost:3000/xx/1](http://localhost:3000/xx/1), when you run \<%=  
link\_to ‘xx’ {:action =\> xx} %\>, ruby will have your params[:id] from  
your original url.  
it looks like reference params[:id].

so if your url [http://localhost:3000/xx/what\_ever\_id](http://localhost:3000/xx/what_ever_id), the link of “\<%=  
link\_to ‘xx’ {:action =\> xx} %\>” will be “\<%= link\_to ‘xx’ {:action =\>  
xx, :id =\> what\_ever\_id} %\>”, understand? you can use \<%= link\_to ‘xx’  
{:controller =\> yy, :action =\> xx} %\> OR xx , i not  
check it but maybe it works.

_~_~_~_~_~\*\*~_~_~_~_~_  
Reinhart Ariando  
YM : Booking2Heaven  
WEB : [http://teapoci.blogspot.com](http://teapoci.blogspot.com)

---

<div class="post-metadata">

**Author:** ![hei](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/h/779978/32.png) [@hei](https://www.ruby-forum.com/u/hei)\
**Post date:** [February 19, 2008, 6:05am UTC](https://www.ruby-forum.com/t/does-id-have-special-meaning/129496/3 "2008-02-19T06:05:10Z")

</div>

Get it !  
Thanks a lot !~~

On Feb 19, 10:21 am, Visit Indonesia 2008 \<rails-mailing-l…@andreas-
