I have a user_inputs table where I am storing the device subscription statuses under a column sub_status and these subscription statuses I want as drop down options Under the same name. Now after selecting one option from the drop down I want to save the id of the status in equipment_assets table under a column_name subscription_status and display the status on the browser. I am trying collection_select for it but its not working.
<div class="pluginESV_formfield">
<%= f.label :subscription_status %><br />
<%= collection_select :sub_status,UserInput.all,:id, :subscription_status %></div>
this gives error, wrong number of arguments, Please help me with this.
here-
- :sub_status is the field which has the drop down options.
- UserInput is the model from which these status are coming.
- :id is the index of the sub_status from the user_inputs table
- :subscription_status is the column in the equipment_assets table where selected IDs will be stored. I am not getting what's wrong with the code.
Please help me out with this.