【发布时间】:2014-10-08 13:33:38
【问题描述】:
使用 x-editable 和 tinymce 编辑字段,但是在重新加载页面时打印返回值并显示 html 代码(使用
等)。保存字段时显示的示例;
<p>this is a test response</p>
<p> </p>
(代替)
this is a test response
可编辑的初始化代码:
$('.editable').editable('option','validate', function (v) {
if (this.dataset.type == 'textarea') {
return {newValue: tinyMCE.activeEditor.getContent()};
}
});
这是可编辑字段:
<%= editable @article, :introduction, url: article_update_path(@article), type: 'textarea', onblur: 'ignore' %>
我希望它显示“html 输出”而不是 html 代码。
【问题讨论】:
标签: javascript ruby-on-rails tinymce-4 x-editable