【发布时间】:2015-11-24 00:59:32
【问题描述】:
我想通过 jbuilder 返回 html 内容:
json.array!(@articles) do |article|
json.extract! article, :id, :title, :html_content
end
但它返回的是转义的 html:
{
"id": 2,
"title": "",
"html_content": "\u003cp\u003e\u003cimg alt=\"\" src=\"#\" /\u003e\u003c/p\u003e\r\n"
}
它如何返回未转义的html?
【问题讨论】:
标签: html ruby-on-rails ruby json jbuilder