Displaying 1 result from an estimated 1 matches for "cmtbox".
Did you mean:
catbox
2010 Sep 27
9
Rails 3 - Creating a comment and then returning the Partial with JUST the new comment
...= lots of stuff going on here but it works...
if @comment.save
flash[:notice] = "Successfully created comment."
respond_to do |format|
format.js
end
end
Ok and this is where I''m stuck, then the create.js.erb:
$(".cmtBox").html("<%=escape_javascript(render :partial
=>"comments/comment")%>");
And the partial:
<div class="cmtBox" id="comment_<%=comment.id%>">
<%=comment.content%>
</div>
Where I''m stuck is calling th...