Forum: Ruby on Rails Rails 1.2.2 link_to question

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
7bf37697edd246a8cbe32ee05d89a7f3?d=identicon&s=25 Joe (Guest)
on 2007-02-24 05:30
(Received via mailing list)
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:

  <a href="/item/new">New Photo</a>

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.
7223c62b7310e164eb79c740188abbda?d=identicon&s=25 Xavier Noria (Guest)
on 2007-02-24 10:29
(Received via mailing list)
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
This topic is locked and can not be replied to.