2011-07-16 2 views
0

J'ai un <% @user.comments.each do |comment| %>Comment puis-je passer une variable d'un chacun à faire un form_for intérieur

et à l'intérieur il est

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

Que puis-je utiliser à ???? pour s'assurer que le courant @user.comment est transmis au contrôleur?

Si je

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

Je reçois

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

montrer vos itinéraires pour les ressources subcomment – fl00r

Répondre

0

Si j'ai bien compris votre question, vous devez créer un champ caché comment_id

Questions connexes