I’m trying to get a collection select list to work, but I’m getting this
error: missing attribute: state_code
The code is a select list for states.
<%= collection_select(:states_code, :state, states.states_list,
:state_code, :state)%>
The above elements are as follows
- table name (singular, full name is states_codes)
- full name of state
- select list that orders the states alphabetically (model and method)
- state abbreviation for value
- full name of state to display
Can anyone help me figure out what I’m doing wrong?
Thanks.