mardi 21 juillet 2015

Use Arrays within the check Box

How can I pass a Array values to check box I have an Array say loan["1","2","3"] and in my view

 <%= check_box_tag "loan[]" ,c.id , true %> 

For the first time i select the ids and Ill save. But at the second time only selected ids(which i have selected for the first time) should be displayed and rest should be unchecked. Thanks in advance




Aucun commentaire:

Enregistrer un commentaire