Unable to select radio buttons using labels in ruby on rails while running through a loop?
问题 Here is the code I am writing for RADIO BUTTON in RAILS <% @Days = ['Monday','Tuesday','Wednesday','Thursday','Friday','Saturday','Sunday'] %> <% @Days.each do |day| %> <%= f.radio_button :due_day, day, :checked => @group.due_day.eql?(day) %> <%= f.label :due_day, day %> <% end %> And at HTML I get <input checked="checked" id="group_due_day_monday" name="group[due_day]" type="radio" value="Monday" /> <label for="group_due_day">Monday</label> ..... ..... <input id="group_due_day_sunday" name=