tarellel / simple_form-tailwind

A basic rails generator for adding a simpleform config for tailwindCSS based forms
MIT License
65 stars 11 forks source link

example for vertical boolean based on a collection? #2

Closed Jarrodsz closed 1 year ago

Jarrodsz commented 2 years ago

Thank you for providing this solution.

Could you please give an example of how to render collection of checkboxes based on vertical_boolean?

= f.input :students
                                    :collection     => Student.all,
                                    :include_blank  => false,
                                    :include_hidden => false,
                                    :label          => "student checkboxes"

Gives just a dropdown instead of a checkbox collection with multiple select. Also how would one save these multiple checkboxes in the database in rails? does the students field need to be of any kind of specific type? Any help or example would be highly appreciated.

I use form like

= simple_form_for(Student.new
                            :html => { :class => '' },
                            url: root_path,
                            wrapper_mappings: { check_boxes: :vertical_boolean,
                                                boolean: :vertical_boolean,
                                               }) do |f|
Jarrodsz commented 2 years ago

Nobody?