0
我有一个评论模型与acts_as_nested_set启用,但当我尝试做这样的事情(对于嵌套评论),我收到错误“comment_comments_path找不到”,大概是因为默认路径doesn不适用于Awesome Nested Set。我如何解决这个问题?使用form_for与真棒嵌套集
<%= form_for([@comment, @comment.children.build]) do |f| %>
<%= f.text_area :content, :placeholder=>'What do you think?'%>
<%= f.submit 'Submit Reply'%>
<% end %>
我也试过这样:
<%= form_for(@comment) do |f| %>
<% @comment.children.each do |sub| %>
<%= f.fields_for :children, sub do |child| %>
<%= child.text_area :content, :placeholder=>'What do you think?'%>
<%= f.submit 'Submit Reply'%>
<% end %>
<% end %>
<% end %>
,但它并没有产生一个文本框,对我来说,在输入