假设我有2个文件,create.js.eex
和post.html.eex
,我想在create.js.eex
模板中呈现post.html.eex
模板的内容。事情是这样的:如何在Phoenix Framework中的javascript模板中呈现html模板
$("#something").append("<%= safe_to_string render "post.html", post: @post %>");
上面的例子不工作,因为我需要逃避被返回的字符串中的报价和其他的东西,我无法找到一个方法来做到这一点
哈哈其实我泼尼松该功能 – JustMichael