Simple Form Adding A Group Label To Collection Select

问题内容:

So I have the following code:

<%= f.collection_radio_buttons :sex, [['male', 'Male'], ['female', 'Female']], :first, :last %>

I would like to add a ‘Gender’ label to the group. Any thoughts on best way to go about doing this?

问题评论:

    
Have you seen this?
    
Did you try f.label :sex, "Gender"? Radio buttons have different behaviour than select, so I think label is the only way.

原文地址:

https://stackoverflow.com/questions/47756758/simple-form-adding-a-group-label-to-collection-select

添加评论

友情链接:蝴蝶教程