Sha256: cd523d1b111097ba4a58009d2f52f5e0db8bdae5512895f0cf89616dbd160145

Contents?: true

Size: 451 Bytes

Versions: 3

Compression:

Stored size: 451 Bytes

Contents

require File.expand_path('../active_record/acts/csv', __FILE__)
require File.expand_path('../csv_rails/array', __FILE__)
ActiveRecord::Base.send(:include, ActiveRecord::Acts::Csv)
Array.send(:include, CsvRails::Array)

ActionController::Renderers.add :csv do |obj, options|
  filename = options[:filename] || File.basename(request.path)
  send_data obj.to_csv(options), :type => Mime::CSV,
  :disposition => "attachment; filename=#{filename}.csv"
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
csv_rails-0.4.1 lib/csv_rails.rb
csv_rails-0.4.0 lib/csv_rails.rb
csv_rails-0.3.0 lib/csv_rails.rb