Topic: Rails escape_javascript is not rendering stuff

Here is my code

$(function(){
$('#new_post').bind('ajax:success', function() {
    $('.posts').append("<%=escape_javascript(render :partial=>'post', :loca\
ls=>{:post=>Post.new})%>");
    });
});

which results in a bizarre output, the page simply append <%=escape_javascript(render :partial=>'post', :locals=>{:post=>Post.new})%> to my list.

Does anyone know how this could happen? Thanks!

Last edited by doctorxlove (2010-11-02 12:08:14)