【发布时间】:2011-07-09 14:58:40
【问题描述】:
我正在尝试在我的 Ruby on Rails 网站上嵌入 Google 文档查看器 (http://googlesystem.blogspot.com/2009/09/embeddable-google-document-viewer.html),但它一直显示“抱歉,不支持查看此类文档”。我的 Rails 代码使用如下所示的 send_file 调用:
send_file(File.join(@document.path, @document.filename), {:filename => @document.name, :type => @document.filetype})
在服务器日志中,我可以看到文件正在发送,但文档查看器没有显示它。有谁知道我该如何解决这个问题?
【问题讨论】:
-
你会尝试不同的文件格式吗?
标签: ruby-on-rails ruby documentviewer sendfile