dimanche 24 novembre 2019

Array returns first element blank in my Rails(3.2.11) multi-select

When I selected multiple values from select list then array returns the first value empty.

= f.select :assignedto, options_from_collection_for_select(User.all, 'name', 'name',f.object.assignedto),{}, { :multiple => true}

I tried with {:include_blank => false} and {:include_hidden => false} but this is not working for rails 3.2.11. I have many solutions to handle this empty value in the controller but I want to stop adding empty value in the array.

Aucun commentaire:

Enregistrer un commentaire