Syntax for form_for when building an array from checkboxes

后端 未结 4 991
北海茫月
北海茫月 2020-12-13 04:44

I\'m making a form for an Order object, and the order has many Products, via a join table called OrderProducts. So, we\'ve got something like this:

<% @o         


        
4条回答
  •  悲&欢浪女
    2020-12-13 05:13

    formastic gem

    check_boxes option is very good to implement multiple checkboxes

    like

    f.input :yourcolumn, :as => :check_boxes, :collection => your_collection
    

提交回复
热议问题