为了从 HTML 生成 PDF,我需要使用另一个 Controller 操作输出 (HTML) 的输出来填充变量。有没有什么优雅的方法,如何获取这个 HTML?
谢谢
最佳答案
您可以使用:
def print
output = render_to_string(:action => :index)
end
在你的 Controller 中。
关于ruby-on-rails - 获取rails3中不同 Controller Action 的输出,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/6262727/