redmine plugins - rails collection_select wrong number of argument error -


i have user_inputs table storing device subscription statuses under column sub_status , these subscription statuses want drop down options under same name. after selecting 1 option drop down want save id of status in equipment_assets table under column_name subscription_status , display status on browser. trying collection_select 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 me this.

here-

  • :sub_status field has drop down options.
  • userinput model these status coming.
  • :id index of sub_status user_inputs table
  • :subscription_status column in equipment_assets table selected ids stored. not getting what's wrong code.

please me out this.

for table equipment_assets field subscription_status, need update collection_select below:

<%= collection_select :equipment_asset, :subscription_status, userinput.all, :id, :sub_status %> 

as per collection_select syntax, i.e.,

collection_select(object, method, collection, value_method, text_method, options = {}, html_options = {}) 

you missed object argument why got error wrong number of arguments. mandatory argument helps form select html element proper id , name upon submission of form selected value of select drop down passed in params hash correctly.


Comments

Popular posts from this blog

windows - Single EXE to Install Python Standalone Executable for Easy Distribution -

c# - Access objects in UserControl from MainWindow in WPF -

javascript - How to name a jQuery function to make a browser's back button work? -