<% @user.comments.each_with_index do |comment,index| %>
     ................
     ................

       <%= form_for [Comment, Subcomment.new],:remote => true do |form| 
%>
          <div id="body">
            <%= form.text_field :body %>
          </div>
            <% form.hidden_field :comment_id ,index[1] %>
          <p>
               <%= form.submit %>
          </p>
      <% end %>
 <% end %>

It insists that comment_id =  Comment

Started POST "/comments/Comment/subcomments" for 127.0.0.1 at 2011-07-17 
17:31:54 +0100
  Processing by SubcommentsController#create as JS
  Parameters: {"utf8"=>"✓", 
"authenticity_token"=>"Ca9IHcB/No8OJ/9MLtXSeuas7n1Mp8GyxpIAMLJxMXo=", 
"subcomment"=>{"body"=>"cat"}, "commit"=>"Create Subcomment", 
"comment_id"=>"Comment"}

What is the correct way to do this?

-- 
Posted via http://www.ruby-forum.com/.

-- 
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Talk" group.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To unsubscribe from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.

Reply via email to