Search code examples
csstwitter-bootstrapruby-on-rails-3.1

ROR Bootstrap radio button alignment


I have a form_for which contains some radio buttons below:

<div class="control-group">
<div class="controls">
<%= f.label :option, 'Option1', :value => true, :class => "radio" %>
<%= f.radio_button :option, true %>
<%= f.label :option, 'Option2', :value => false, :class => "radio" %>
<%= f.radio_button :option, false %>
</div>
</div>

im using twitter bootstrap and I want my radio buttons to display as such:

O Option1 O Option2

however presently they are displaying:

---- Option1

O

---- Option2

O

any advice would be much appreciated.


Solution

  • I would look at the bootstrap css and how they do it with form-inline. but for the alignemt if you changge the class name from "controls" to "controls continline"

    then in the css do this:.

    .controls.continline
    {
       display: inline-block;
    }
    

    this should be what your after.