0

我有一个<% @user.comments.each do |comment| %>

里面是

<%= form_for [????, Subcomment.new],:remote => true do |form| %>

我可以在什么地方使用???确保电流@user.comment传递到控制器?

如果我使用

<%= form_for [comment, Subcomment.new],:remote => true do |form| %>

我明白了

No route matches {:controller=>"subcomments", :comment_id=>#<Comment body: "Comments coming up twice", user_id: 2, commenter: "gleb", id: nil>}
4

1 回答 1

0

如果我的问题正确,您需要创建一个隐藏字段comment_id

于 2011-07-17T18:30:05.663 回答