集输出我有这样的代码:Ruby on Rails的在collection_select
<%= collection_select :channel, @channelList, :id, :channelname, {prompt: (t "channel.add.prompt")}, class: "form-control"%>
而得到这个错误:
其正常活动的关系
这是什么我的错误?
感谢
集输出我有这样的代码:Ruby on Rails的在collection_select
<%= collection_select :channel, @channelList, :id, :channelname, {prompt: (t "channel.add.prompt")}, class: "form-control"%>
而得到这个错误:
其正常活动的关系
这是什么我的错误?
感谢
您必须指定:object, method, collection, value_method, text_method
,你可能忘了设置object
PARAM。
这将使这样的:
<%= collection_select :object, :channel, @channelList, :id, :channelname, {prompt: (t "channel.add.prompt")}, class: "form-control"%>
(更换:object
与你的对象,你要的通道保存)
''@channelList它包含的? –
@RajarshiDas看他最后的截图。 – siegy22