def download
send_file File.join(Rails.root, "public", @doc.link), :filename => @title+".pdf", :type => "application/force-download", :x_sendfile=>true
end
def download
send_file File.join(Rails.root, "public", @doc.link), :filename => @title+".pdf", :type => "application/force-download", :x_sendfile=>true
end
转载于:https://www.cnblogs.com/znsongshu/p/9741829.html