[英]How to update partial using Ajax call and then render in Rails?
我沒有使用erb,而是使用了haml。 所以像這樣:
$("<%= escape_javascript(render @user) %>").appendTo("#users");
http://edgeguides.rubyonrails.org/working_with_javascript_in_rails.html中的內容無效。
有人有想法嗎?
對於HAML
,請如下使用字符串插值 :
$("#{escape_javascript(render @user)}").appendTo("#users");
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.