Rails/Formtastic many-to-many ordered list HTML -
Rails/Formtastic many-to-many ordered list HTML -
i have post model many-to-many category association. in post form, phone call f.input :categories, :as => :check_boxes
, nice ordered list of check boxes. there anyway add together class each <li>
using category's name (or category data)?
example:
<li class="<%= category.name %>">...label , input...</li> <li class="<%= category.name %>">...label , input...</li> <li class="<%= category.name %>">...label , input...</li>
thanks!
try like
f.input :categories, :as => :check_boxes, :value_as_class => true
ruby-on-rails formtastic
Comments
Post a Comment