There is a list in the database enum ('name_1', 'name_2', 'name_3'). A controller and model was created, everything works fine.

Later I changed the list to ('new_name_1', 'new_name_2', 'new_name_3'), but in the data entry form I still see the old list ('name_1', 'name_2', 'name_3'), respectively when I try to save it pops up mistake because There is a mismatch with the base.

Tell me, is it possible to change the enum list somewhere? I understand that it was fixed somewhere when creating a model or controller.

Thank.

Closed due to the fact that off-topic participants cheops , user194374, aleksandr barakin , Bald , kmv 19 Jul '16 at 14:09 .

It seems that this question does not correspond to the subject of the site. Those who voted to close it indicated the following reason:

  • “Questions asking for help with debugging (“ why does this code not work? ”) Should include the desired behavior, a specific problem or error, and a minimum code for playing it right in the question . Questions without an explicit description of the problem are useless for other visitors. See How to create minimal, self-sufficient and reproducible example . " - cheops, Community Spirit, aleksandr barakin, Bald, kmv
If the question can be reformulated according to the rules set out in the certificate , edit it .

  • If you created the ActiveRecord model via gii, look in it. - NPreston

2 answers 2

It is necessary to change the name_1,name_2,name_3 attributes in the model to new_name_1, new_name_2, new_name_3

    In general, it was necessary, in addition to the database, to change the form ...