我的控制器: -如何使下載鏈接在紅寶石
def download
send_file("/123.zip")
end
我下載的觀點: -
<h1>Hello World</h1>
從那裏我打電話下載選項: -
<%= link_to 'download', :class => "btn btn-large btn-danger" do %>
請幫助我如何使該鏈接.. 現在這是顯示錯誤
Sent file /123.zip (1.0ms)
DEPRECATION WARNING: Passing a template handler in the template name is deprecated. You can simply remove the handler name or pass render :handlers => [:erb] instead. (called from c:in `find_template':)
Rendered layouts/error/application.html.erb within layouts/application (0.0ms)
Rendered layouts/_sidebar.html.erb (13.0ms)
Completed 404 Not Found in 60ms (Views: 50.0ms | ActiveRecord: 4.0ms)
你可以粘貼你的'rake routes'命令輸出嗎? –
我是新來的,所以你的意思是我的路線? 匹配「/ PatientManagement/download」=>'current_inpatient#download' –
打開您的終端,轉至您的項目目錄,然後執行此命令'rake routes'。這會列出項目中所有可用的路徑。 –