Search code examples
ruby-on-rails-3formtastic

Formtastic group inputs


Is there a way to group inputs under one label and display in inline? To avoid something like this:

.input.optional
  = form.label :price
  .input
    = form.text_field :price
    = form.select :currency

Solution

  • There's nothing in Formtastic for this, but you can achieve the same visual affect by using two standard Formtastic inputs one after the other and styling them to appear "inline". This means you might want to wrap them in a containing field set, float them against each other, and visually hide one or both of the labels.