@sunny @comment does not exists inside the create action, and he needs to
iterate over a collection , @comments


<%=escape_javascript(render :partial =>"comments/comment", :locals =>
{:comments =>fill the comments collection...))%>


or


@comment =  lots of stuff going on here but it works...
@comments = fill the comments collection..
       if @comment.save
         flash[:notice] = "Successfully created comment."
         respond_to do |format|
          format.js
       end
     end

then

<%=escape_javascript(render :partial =>"comments/comment", :locals =>
{:comments => @comments))%>


@comments does not exists inside the response from create.js.erb so you have
to build it there or in the controller's create action before the respond_to
block


you can check my example

http://github.com/rbritom/Simple_polymorphic_nested_comments

-- 
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 [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.

Reply via email to