我想打印在Ruby中的HTML表格on Rails的打印HTML標記Ruby on Rails的
<h1>Welcome</h1>
<p>
<%= sprintf print_series(@myTable) %>
</p>
*助手:
module WelcomeHelper
def print_series(graph)
res = '<table border="2">'
graph.each {
|point|
res = res + new_row(new_cell(point["date"]) + new_cell(point["value"]))
}
res << '</table>'
return res.html_safe
end
end
似乎沒有任何工作,我不斷收到HTML標籤已經逃脫了,這樣我就可以在瀏覽器上「查看」HTML而不是看到表格了。 我在做什麼錯?
主持人......如何編輯我的帖子,所以它看起來正常??? – eran
縮進代碼行4個或更多空格。查看我的編輯。 –
非常感謝。抱歉,添麻煩了。 – eran