Skip to content

check_boxes input preselection

jmarceli edited this page Jun 8, 2015 · 1 revision

In order to define which check_boxes should be preselected use checked option. Example (in HAML):

= simple_form_for @car do |f|
  = f.input :features, as: :check_boxes, 
    collection: ["air condition", "radio", "4 wheel drive", "cruise control"], 
    checked: ["air condition", "radio"]