I’m looking at the simple-form-bootstrap page and I can’t figure out how to render check boxes.
Let’s say I have four check boxes corresponding to four boolean table columns like in the example: Blog, Editorial, Announce, Advertisement.
The code looks like so:
<%= f.input :content_type, :collection => content_type_options, :as => :check_boxes %>
I’m guessing content_type_options would be an array of the four aforementioned checkboxes, right? Well what do I put for :content_type?
simple_form will bind the selected options to the
params[:content_type]variable.Note:
content_type_optionscan also be a hash containing pairs of option/value. e.g. {‘Blog’ => ‘blog’, ‘Editorial’ => ‘editorial’, …}