有没有办法将关联模型放入simple_form_for
?simple_form_for中的关联模型
我有下面的代码
= simple_form_for(@booth.chats, remote: true) do |f|
但是这给了我下面的错误:
NoMethodError at /booths/1
undefined method `model_name' for #<Class:0x86f6418>
整个表单代码:
= simple_form_for(@booth, remote: true) do |f|
= f.simple_fields_for(:chats) do |c|
.input-group
%input#btn-input.form-control.input-sm{placeholder: "Type your message here...", type: "text"}
%span.input-group-btn
%button#btn-chat.btn.btn-warning.btn-sm{:type => 'submit'}
Send
= f.error_notification
PD嗨:D显示更多的代码协会记录使用内
simple_form_for
simple_fields_for
喜欢如下产生的? – Narfanator@Narfanator我刚更新了整个表格代码:) –