[英]How to add html file into active admin page and make it a part of page?
現在我有了XML格式的信息,我需要使用stylesheet.xslt進行轉換以接收HTML表。 我嘗試將此HTML表放入管理頁面(我使用活動管理),但獲取HTML文件的文本。 但是我想在轉換后看到一張表
我試圖將其放入不同的標簽(div / pre),無濟於事
pre id: 'response_xml_into_html', class: 'collapse' do
document = Nokogiri::XML(request)
template = Nokogiri::XSLT(File.read('stylesheet.xslt'))
template.transform(document)
不確定,但是請嘗試以下操作:
document = Nokogiri::XML(request)
template = Nokogiri::XSLT(File.read('stylesheet.xslt'))
htmltable_out = template.transform(document)
div(id: 'response_xml_into_html', class: 'collapse') do
htmltable_out.html_safe
end
另外,請確保啟動rails console
查看轉換是否確實有效。 祝好運!
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.