-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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"]
This page was created by the OSS community and might be outdated or incomplete. Feel free to improve or update this content according to the latest versions of SimpleForm and Rails to help the next developer who visits this wiki after you.
Keep in mind to maintain the guides as simple as possible and to avoid additional dependencies that might be specific to your application or workflow (such as Haml, RSpec, Guard and similars).