# Rails 1.2.2 link\_to question

**URL:** <https://www.ruby-forum.com/t/rails-1-2-2-link-to-question/86657>\
**Category:** Rails\
**Created:** [February 24, 2007, 5:30am UTC](https://www.ruby-forum.com/t/rails-1-2-2-link-to-question/86657 "2007-02-24T05:30:37Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![joe](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/b9e5f3/32.png) [@joe](https://www.ruby-forum.com/u/joe)\
**Post date:** [February 24, 2007, 5:30am UTC](https://www.ruby-forum.com/t/rails-1-2-2-link-to-question/86657/1 "2007-02-24T05:30:37Z")

</div>

This didn’t get answered before, I’m not quite sure if the silence is  
telling me that I’m an idiot and it should be obvious, or if the  
silence indicates that no one knows why a simple thing shouldn’t work.

I’ve tried this on a linux Centos install, and now my mac. I get the  
same result.

In my view I have  
\<%= link\_to “New #{@item\_class}”, {:action =\>  
‘new’, :item\_class=\>@item\_class} %\>

which shows up as in the html source:

[New Photo](https://www.ruby-forum.com/item/new)

note that the extra “item\_class” is not getting added, such as

/item/new?item\_class=Photo

which is what 1.1.6 did.

Note that I added the brackets to create a hash for 1.2.2, previously  
in 1.1.6 I had

\<%= link\_to “New #{@item\_class}”, :action =\>  
‘new’, :item\_class=\>@item\_class %\>

which worked.

Any guidance appreciated.

---

<div class="post-metadata">

**Author:** ![joe](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/b9e5f3/32.png) [@joe](https://www.ruby-forum.com/u/joe)\
**Post date:** [February 24, 2007, 10:29am UTC](https://www.ruby-forum.com/t/rails-1-2-2-link-to-question/86657/2 "2007-02-24T10:29:57Z")

</div>

On Feb 24, 2007, at 5:29 AM, Joe wrote:

> /item/new?item\_class=Photo
> 
> which is what 1.1.6 did.
> 
> Note that I added the brackets to create a hash for 1.2.2, previously  
> in 1.1.6 I had
> 
> \<%= link\_to “New #{@item\_class}”, :action =\>  
> ‘new’, :item\_class=\>@item\_class %\>
> 
> which worked.

It still works that way. The extra parameter does not show up if its  
value is nil.

– fxn
