3
$('body').replaceWith('<%= escape_javascript(render(:partial => 'search_result2', :query => @result_query)) %>');

我想在.html.hamlJavaScript 中使用它,

$('body').replaceWith('<%= escape_javascript(render(:partial => 'search_result2', :query => @result_query)) %>');

如何更改此行

<%= escape_javascript(render(:partial => 'search_result2', :query => @result_query)) %>
4

1 回答 1

5

尝试这个

#{ escape_javascript(render(:partial => 'search_result2', :query => @result_query)) }
于 2013-04-10T09:36:05.950 回答