Forum: Ruby on Rails More radio_buttons

Announcement (2017-05-07): is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see and for other Rails- und Ruby-related community platforms.
C4bfcc81ac9281cb905f38e97e4d4e0b?d=identicon&s=25 Shandy Nantz (snantz)
on 2007-07-12 16:17
I posted a question yesterday about radio buttons and got some good
feedback, but I don't think I was asking the right question. I'm using a
group of three radio buttons to let me know if a user would like info
about there accounts sent to Home, Work, or Other. These values are
stored in a data base as booleans. Now, because of the was the helpers
are set up, it seems to me that I can't have the buttons in a group
while still having them right the right database because of the "name"
attribute and how rails writes the html. For example, I need the radio
button Home to look something like this:

<%= radio_button_tag 'user', 'd_home', true, {:id => 'user[d_home]'} %>

While the radio button for work looks like:

<%= radio_button_tag 'user', 'd_work', true, {:id => 'user[d_work] } %>


<%= radio_button_tag 'user', 'd_other', true, {:id => 'user[d_other]' }

Now, these field would hit the database correctly, but they do not,
however, belong to the same group, which is what I need. Any ideas,

This topic is locked and can not be replied to.