你的浏览器禁用了JavaScript, 请开启后刷新浏览器获得更好的体验!
输入关键字进行搜索
搜索:
没有找到相关结果
快网
赞同来自:
respond_to do |format| ... format.csv { render :layout => false } end
<%= this_is_your_view_helper_method.html_safe %>
require 'csv' def this_is_your_view_helper_method CSV.generate do |csv| Product.find/:all/.each do |product| csv << ... add stuff here ... end end end
帅驴
要回复问题请先登录或注册
2 个回复
快网
赞同来自:
控制器:
show.csv.erb:
controller_helper.rb:
帅驴
赞同来自:
https://coderoad.ru/4822422/
Stack Overflow 用来 CSV 在 Ruby 1.9.x /作为手动指出,其中包括 FasterCSV, 但是有一些其他语法/.