Search code examples
ruby-on-railsformtastic

rails 3 formtastic align radio buttons horizontally


How do I get radio buttons to align horizontally? for example:

<%= f.input :rating, :as => :radio, :collection => [["1", 1], ["2", 2], ["3", 3]] %>

is displayed as,

rating

[ ] 1

[ ] 2

[ ] 3

I want:

rating [ ] 1 [ ] 2 [ ] 3

Update: fixed by adding

.formtastic fieldset > ol >li.radio fieldset ol li {
  margin:0.1em 0.5em 0.5em 0;
  display: inline-block;
}

to active_admin.css.scss


Solution

  • From the formtastic wiki on css customization and here, it seems that css is the way to do it.