Include two inputs in the same LI element in Formtastic

Using formtastic, I have a quantity field and a unit field that requests the quantity of the element and the unit in which it is measured.

My problem is that I would like the block field to be displayed along the quantity field. However, since formtastic pust each entry into its own LI element, I cannot make them appear next to each other.

Any ideas?

+5
source share
1 answer

Use the html wrapper for quantity and unit fields:

<%= form.input :quantity,   :wrapper_html => { :class => 'fl' } %>
<%= form.input :unit,       :wrapper_html => { :class => 'fl' } %>

css (, formtastic-changes.css), float css float li. , :

form.formtastic fieldset ol li.fl {float: left; margin-right: 2em;}

, wrapper_html css, , .

+9

All Articles