Suppose I have a form in new.html.erb with some checkboxes and select tags and other text_fields. And suppose I create a record (check one or more checkboxes and select something) and save it to DB successfully. When I go to edit.html.erb which should edit this record I have the following situation:
1) All text_fields are filled with the values of that record I want to edit (OK)
2) But checkboxes are all unchecked (NOT OK)
3) Nothing is selected in select tag (NOT OK)
So 2nd and 3rd points are problematic. How to populate checkboxes and select tag when editing a record?
Aucun commentaire:
Enregistrer un commentaire