# Capturing radio button values for nested object

**URL:** <https://www.ruby-forum.com/t/capturing-radio-button-values-for-nested-object/111286>\
**Category:** Rails\
**Created:** [August 5, 2007, 12:59am UTC](https://www.ruby-forum.com/t/capturing-radio-button-values-for-nested-object/111286 "2007-08-05T00:59:09Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![casper\_the\_ghost](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/58956e/32.png) [@casper\_the\_ghost](https://www.ruby-forum.com/u/casper_the_ghost)\
**Post date:** [August 5, 2007, 12:59am UTC](https://www.ruby-forum.com/t/capturing-radio-button-values-for-nested-object/111286/1 "2007-08-05T00:59:09Z")

</div>

I have a user object and an account object. User has one account  
object. In the signup.rhtml I have a radio button that has three  
options for the membership (yearly, monthly and sample). How do I  
populate the account model when the user submits the form?  
Is the following syntax correct?

\<%= radio\_button(“user[account]”, “membership”, “Yearly”) %\>  
Yearly  
  
\<%= radio\_button(“user[account]”, “membership”, “Monthly”) %\>  
Monthly  
  
\<%= radio\_button(“user[account]”, “membership”, “Sample”) %\>  
Sample

TIA
