# More radio\_buttons

**URL:** <https://www.ruby-forum.com/t/more-radio-buttons/109231>\
**Category:** Rails\
**Created:** [July 12, 2007, 4:17pm UTC](https://www.ruby-forum.com/t/more-radio-buttons/109231 "2007-07-12T16:17:14Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![snantz](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/c2a13f/32.png) [@snantz](https://www.ruby-forum.com/u/snantz)\
**Post date:** [July 12, 2007, 4:17pm UTC](https://www.ruby-forum.com/t/more-radio-buttons/109231/1 "2007-07-12T16:17:14Z")

</div>

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] } %\>

Other,

\<%= 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,  
thanks

~S
