Trying to Create a Radio Button
I'm trying to create a radio button. So far, I added a field to my accounts tables using " rails g migration AddReturnToAccounts return:boolean" then modifying the migration file so that the default value is false "default : false. Then I added:
<%= f.label :return %><br>
<%= f.radio_button :return, class: "form-control" %> Returning Client?
to _form.html.erb and it show up fine. Lastly, I added :return to def account_params in the accounts controller but it doesn't seem like it is saving the value of the button once I select it. What am I missing? I hope that I'm posting this in the correct section.
Posted almost 5 years ago by