Rails 导出cvs 和 excel
1. 在application.rb文件中增加
?
?
?最后在index.html.erb文件中增加下载链接,点击后就可以直接下载了
?
?
<p> <%= link_to "CSV", week_plans_path(format: "csv") %> <%= link_to "EXCEL", week_plans_path(format: "xls") %></p>转载请注明:http://michael-roshen.iteye.com/blog/1668296