我将数据导出到XLS
和
def export_report
require 'csv'
@call_requests = CallRequest.reorder("created_at desc")
@call_requests = @call_requests.where(:device=> params[:device]) if params[:device].present?
@call_requests = @call_requests.where(:status => params[:status]) if params[:status].present?
.....
end
我将传递许多参数(9~10的参数)
<%= link_to export_report_admin_call_requests_path(device: params[:device], status: parmas[:status], ......format: "xls") do %>
Export Report
<% end %>
传递所有参数
是如此之久可以传递所有参数吗?
答案 0 :(得分:0)
您只需将format
数据合并到params
。
<%= link_to export_report_admin_call_requests_path(params.merge(format: 'xls')) do %>
Export Report
<% end %>