我正在尝试显示评论列表和使用 AJAX 发表新评论的表单。simple_form_for 块给出以下错误:ArgumentError in DeliveryNegotiations#show Showing /home/action/socialpost/app/views/delivery_negotiations/show.js.erb where line #10 raise: Missing block
这是 show.js.erb 文件:
$("#conversation").html(
'<% @comments.each do |com| %> \
<strong> <%=j "User " + com.author_id.to_s + ":" %> </strong> \
<%=j (com.comment || " ") %> \
<br/> \
<% end %> \
<fieldset> \
<legend> \
New comment \
</legend> \
<%=j form_for ([@delivery_request, @delivery_negotiation, @comment]) do |builder| %> \
<%=j builder.text_area :comment %> \
<%=j builder.hidden_field :author_id, value: current_user.id %> \
<%=j builder.submit %> \
<% end %> \
</fieldset>\
');
任何帮助将不胜感激。