Sha256: 78b41db75fd4f582c7fb096ad2c98a92400bf332b89f8d3e5d99e8090bc11fbe
Contents?: true
Size: 595 Bytes
Versions: 16
Compression:
Stored size: 595 Bytes
Contents
# For further explanation, check out RFC 2183 # https://www.ietf.org/rfc/rfc2183.txt ActionController.add_renderer :csv do |obj, options| filename = options.fetch(:filename, 'data') disposition_type = options[:inline] || filename == 'inline' ? 'inline' : 'attachment' disposition_params = [disposition_type] if filename != 'inline' filename = "#{filename}.csv" unless filename =~ /\.csv$/ disposition_params << "filename=#{filename}" end str = obj.respond_to?(:to_csv) ? obj.to_csv : obj.to_s send_data str, type: Mime::CSV, disposition: disposition_params.join(';') end
Version data entries
16 entries across 16 versions & 1 rubygems