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
Using Haml, getting rid of needless br tags, and nesting inputs within label so that they may be selected without matching labels to ids. Also using form_for. I would consider this to be following best practices.
= form_for current_user do |form|
.form_row
%label Theme:
- [ 'plain', 'desert', 'green', 'corporate', 'funky' ].each do |theme|
%label
= form.radio_button(:theme, theme)
= theme.humanize