2013-02-28 121 views
1

我知道这个问题很简单,但我还不能解决。可能你们的眼睛比我更锐利。collections_for_select总是返回错误的参数数量(0代表1)'

我有select_tag其中:

<%= f.select :product_type, options_for_select([["Raw Material", "0"], ["Semi Material", "1"], ["Finish", "2"]], @product.product_type,), { :prompt => "Select Product Type" }, :required => true %> 

简单select_tag但它总是返回wrong number of arguments (0 for 1)

我尝试从我的其他select_tag复制粘贴是非常类似像这样的,把它的网页上工作完美,但仍然在此页面上返回该错误。

我尝试破解密码是:

33. <%= f.select :product_type, options_for_select([["Raw Material", "0"], 
34. ["Semi Material", "1"], 
35. ["Finish", "2"]], 
36. @product.product_type, 
37.), { :prompt => "Select Product Type" }, :required => true %> 

而且它在该行36返回错误。

我不知道为什么使这不起作用。由于

回答

0

你可以尝试在36行

+0

不,先生,它仍然是相同的,但不好意思,是我在我的模型错误。我为自己回答。谢谢你 – ksugiarto 2013-02-28 07:53:28

1

据我的错误在我的模型,我创建了一个在球场上有同名的程序结束时删除尾部逗号。所以,这就是为什么它总是在我的模型返回错误原因def product_type(id)

真的很抱歉。谢谢你

相关问题