0
votes

I'm using the gem simple_form with Rails to create my forms.

I want to create radio_buttons that have the input tag wrapped in the label tag, for example:

<label>
  <input id="optionsRadios2" name="optionsRadios" value="option2" type="radio"/>
  Option one
</label>

but what I get is this:

<input id="optionsRadios" name="optionsRadios" value="option2" type="radio"/>
<label for="optionsRadios1"> Option one</label>

Is there a way to create the input tag inside label tag using wrappers? how?

I could not find any ways by now (here is the doc: http://www.rubydoc.info/github/plataformatec/simple_form/master/SimpleForm/FormBuilder:collection_radio_buttons)

Thanks for any help!

1

1 Answers

1
votes

Try this:

<%= f.collection_radio_buttons :options, [[true, 'Yes'] ,[false, 'No']], :optionsRadios1, :optionsRadios2, {:item_wrapper_class => 'inline'}, {:class => "radio-inline" }%>