ruby on rails - How to generate a radio-inline label with simple_form and bootstrap? -


i'm using:

<%= simple_form_for @visitor, html: {class: 'form-inline'} |f| %>     <%= f.error_notification %>     <%= f.input :favorite, label: false, as: :radio_buttons %>     <%= f.submit "choose!", :class => "btn btn-primary"%> <% end %> 

and html:

<div class="control-group radio_buttons required visitor_favourite">     <div class="controls">         <label class="radio">             <input class="radio_buttons required" id="visitor_favourite_true" name="visitor[favourite]" type="radio" value="true" />             yes         </label>         <label class="radio">             <input class="radio_buttons required" id="visitor_favourite_false" name="visitor[favourite]" type="radio" value="false" />             no         </label>     </div> </div> 

but i'm looking way generate labels radio-inline because style want:

<label class="radio-inline">  

there similar question here "radio inline" class , desn't work generate radio-inline.

i'm using simple_form 3.0.2 , tried 3.1.0rc2 , bootstrap 3.2.0 rails 4.1.4 anyway or method solve this?

i got following work under simple_form 3.1.0:

f.input :favorite, label: false, as: :radio_buttons,          item_label_class: "radio-inline", item_wrapper_tag: false 

Comments

Popular posts from this blog

javascript - Jquery show_hide, what to add in order to make the page scroll to the bottom of the hidden field once button is clicked -

javascript - Highcharts multi-color line -

javascript - Enter key does not work in search box -