Forum: Ruby on Rails radio_button_tag quirkiness...

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.
6dfd01c549aa33a158730c7d9f7064cc?d=identicon&s=25 Da Plutes (plutes)
on 2006-01-28 00:45
...or my ineptitude?


I found that the following is always checking the last 'things' button
regardless of the value of query.table:

People:<%= radio_button_tag("query", "table", "P") %>
Animals:<%= radio_button_tag("query", "table", "A") %>
Things:<%= radio_button_tag("query", "table", "T") %>

But the following works correctly:

People:<%= radio_button(:query, :table, "P") %>
Animals:<%= radio_button(:query, :table, "A") %>
Things:<%= radio_button(:query, :table, "T") %>
Ad7805c9fcc1f13efc6ed11251a6c4d2?d=identicon&s=25 Alex Young (Guest)
on 2006-01-28 18:57
(Received via mailing list)
dr plutes wrote:
> But the following works correctly:
>
> People:<%= radio_button(:query, :table, "P") %>
> Animals:<%= radio_button(:query, :table, "A") %>
> Things:<%= radio_button(:query, :table, "T") %>
>
>
That looks like one of those places that symbols and strings are not
created equal.  Don't worry about it, it's Rails being a tad quirky :-)
  In general, in Ruby, symbols and strings are very different creatures.
  Rails goes through quite a few contortions to make them
interchangeable, but there are a few places that slip through the
cracks...
This topic is locked and can not be replied to.