I want to save value from my checkbox's form as boolean, but i have got an array
Chunk of my log "important"=>[""]
or if i checked it
"important"=>["", "true"]
my table
t.boolean :important, :default => false
my form
f.input :important, :as => :check_boxes, collection: [true]
How to fix it?
i think problem in my form's input
Use
f.input :important, as: :boolean
Instead.
EDIT
as: check_boxes
is meant for collections (selecting many values from a collection).
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With