Sha256: 6562a14e5f46535e7676132351a9a1cb82c14a89eafabce2d566adc3f7f323cd

Contents?: true

Size: 1.22 KB

Versions: 18

Compression:

Stored size: 1.22 KB

Contents

class ExportController < ArtfullyOseController

  def contacts
    @organization = current_user.current_organization
    @filename = "Artfully-People-Export-#{DateTime.now.strftime("%m-%d-%y")}.csv"
    @csv_string = @organization.people.includes(:tags, :phones, :address).all.to_comma
    send_data @csv_string, :filename => @filename, :type => "text/csv", :disposition => "attachment"
  end

  def donations
    @organization = current_user.current_organization
    @filename = "Artfully-Donations-Export-#{DateTime.now.strftime("%m-%d-%y")}.csv"
    @items = ItemView.where(:organization_id => current_organization).where(:product_type => "Donation").all
    @csv_string = @items.to_comma(:donation)  
    send_data @csv_string, :filename => @filename, :type => "text/csv", :disposition => "attachment"
  end

  def ticket_sales
    @organization = current_user.current_organization
    @filename = "Artfully-Ticket-Sales-Export-#{DateTime.now.strftime("%m-%d-%y")}.csv"
    @items = ItemView.where(:organization_id => current_organization).where(:product_type => "Ticket").all
    @csv_string = @items.to_comma(:ticket_sale)    
    send_data @csv_string, :filename => @filename, :type => "text/csv", :disposition => "attachment"
  end

end

Version data entries

18 entries across 18 versions & 1 rubygems

Version Path
artfully_ose-1.2.0.pre.19 app/controllers/export_controller.rb
artfully_ose-1.2.0.pre.18 app/controllers/export_controller.rb
artfully_ose-1.2.0.pre.17 app/controllers/export_controller.rb
artfully_ose-1.2.0.pre.16 app/controllers/export_controller.rb
artfully_ose-1.2.0.pre.15 app/controllers/export_controller.rb
artfully_ose-1.2.0.pre.12 app/controllers/export_controller.rb
artfully_ose-1.2.0.pre.11 app/controllers/export_controller.rb
artfully_ose-1.2.0.pre.10 app/controllers/export_controller.rb
artfully_ose-1.2.0.pre.9 app/controllers/export_controller.rb
artfully_ose-1.2.0.pre.8 app/controllers/export_controller.rb
artfully_ose-1.2.0.pre.7 app/controllers/export_controller.rb
artfully_ose-1.2.0.pre.6 app/controllers/export_controller.rb
artfully_ose-1.2.0.pre.5 app/controllers/export_controller.rb
artfully_ose-1.2.0.pre.4 app/controllers/export_controller.rb
artfully_ose-1.2.0.pre.3 app/controllers/export_controller.rb
artfully_ose-1.2.0.pre.2 app/controllers/export_controller.rb
artfully_ose-1.2.0.pre.1 app/controllers/export_controller.rb
artfully_ose-1.2.0.pre app/controllers/export_controller.rb