Ruby on rails 3.2 下载当前页面时缺少模板错误

Ruby on rails 3.2 下载当前页面时缺少模板错误,ruby-on-rails-3.2,save,send,missing-template,Ruby On Rails 3.2,Save,Send,Missing Template,我试图通过单击按钮保存显示的网页(就像您在浏览器中单击“另存为”按钮时一样),但我无法找出此错误: Missing template shipments/save_page_xls, application/save_page_xls with {:locale= [:en], :formats=>[:html], :handlers=>[:erb, :builder, :coffee, :haml]}. Searched i n: * "/home/andres/Documents

我试图通过单击按钮保存显示的网页(就像您在浏览器中单击“另存为”按钮时一样),但我无法找出此错误:

Missing template shipments/save_page_xls, application/save_page_xls with {:locale=
[:en], :formats=>[:html], :handlers=>[:erb, :builder, :coffee, :haml]}. Searched i
n: * "/home/andres/Documents/Aptana Studio 3 Workspace/EcuadorCargo/app/views" * "
/var/lib/gems/1.9.1/gems/devise-2.1.2/app/views" * "/var/lib/gems/1.9.1/gems/twitt
er-bootstrap-rails-2.1.1/app/views"
我认为问题在于渲染函数不应该在控制器中,或者渲染函数没有找到正确的布局文件。我基于这个页面

视图(在haml中):

控制器文件:

class ShipmentsController < ApplicationController
  def save_page_xls
    #this is the magic line!
    send_data(render, :filename => "archivo.xls")
  end
end
class ShipmentsController < ApplicationController
  def save_page_xls
    #this is the magic line!
    send_data(render, :filename => "archivo.xls")
  end
end
resources :shipments, :only => :index do 
  collection do
    get 'save_page_xls'
  end
end