Similar to this question: Checkboxes on Rails
What's the correct way of making radio buttons that are related to a certain question in Ruby on Rails? At the moment I have:
<div class="form_row">
<label for="theme">Theme:</label>
<br><%= radio_button_tag 'theme', 'plain', true %> Plain
<br><%= radio_button_tag 'theme', 'desert' %> Desert
<br><%= radio_button_tag 'theme', 'green' %> Green
<br><%= radio_button_tag 'theme', 'corporate' %> Corporate
<br><%= radio_button_tag 'theme', 'funky' %> Funky
</div>
I also want to be able to automatically check the previously selected items (if this form was re-loaded). How would I load the params into the default value of these?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…