Sha256: 1aee23c964710c306a13497564dc4843b6e98eff835382f78f466bf05f1ef45d

Contents?: true

Size: 324 Bytes

Versions: 53

Compression:

Stored size: 324 Bytes

Contents

ActionController::Renderers.add :csv do |obj, options|
  csv = obj.respond_to?(:to_csv) ? obj.to_csv(options) : obj

  if filename = options[:filename]
    send_data csv, type: Mime::CSV, disposition: "attachment; filename=#{filename}.csv"
  else
    self.content_type   ||= Mime::CSV
    self.response_body  = csv
  end
end

Version data entries

53 entries across 53 versions & 2 rubygems

Version Path
locomotivecms-3.3.0 config/initializers/csv_renderer.rb
locomotivecms-3.3.0.rc3 config/initializers/csv_renderer.rb
locomotivecms-3.3.0.rc2 config/initializers/csv_renderer.rb
locomotivecms-3.1.2 config/initializers/csv_renderer.rb
locomotivecms-3.2.1 config/initializers/csv_renderer.rb
locomotivecms-3.3.0.rc1 config/initializers/csv_renderer.rb
locomotivecms-3.2.0 config/initializers/csv_renderer.rb
locomotivecms-3.2.0.rc2 config/initializers/csv_renderer.rb
locomotivecms-3.2.0.rc1 config/initializers/csv_renderer.rb
locomotivecms-3.1.1 config/initializers/csv_renderer.rb
locomotivecms-3.1.0 config/initializers/csv_renderer.rb
locomotivecms-3.1.0.rc3 config/initializers/csv_renderer.rb
locomotivecms-3.1.0.rc2 config/initializers/csv_renderer.rb
locomotivecms-3.1.0.rc1 config/initializers/csv_renderer.rb
locomotivecms-3.0.1 config/initializers/csv_renderer.rb
locomotivecms-3.0.0 config/initializers/csv_renderer.rb
locomotivecms-3.0.0.rc7 config/initializers/csv_renderer.rb
locomotivecms-3.0.0.rc6 config/initializers/csv_renderer.rb
locomotivecms-3.0.0.rc5 config/initializers/csv_renderer.rb
locomotivecms-3.0.0.rc4 config/initializers/csv_renderer.rb