Class: ExportController
- Inherits:
-
ArtfullyOseController
- Object
- ActionController::Base
- ArtfullyOseController
- ExportController
- Defined in:
- app/controllers/export_controller.rb
Instance Method Summary collapse
Instance Method Details
#contacts ⇒ Object
3 4 5 6 7 8 |
# File 'app/controllers/export_controller.rb', line 3 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 |
#donations ⇒ Object
10 11 12 13 14 15 |
# File 'app/controllers/export_controller.rb', line 10 def donations @organization = current_user.current_organization @filename = "Artfully-Donations-Export-#{DateTime.now.strftime("%m-%d-%y")}.csv" @csv_string = @organization.donations.all.to_comma(:donation) send_data @csv_string, :filename => @filename, :type => "text/csv", :disposition => "attachment" end |
#ticket_sales ⇒ Object
17 18 19 20 21 22 |
# File 'app/controllers/export_controller.rb', line 17 def ticket_sales @organization = current_user.current_organization @filename = "Artfully-Ticket-Sales-Export-#{DateTime.now.strftime("%m-%d-%y")}.csv" @csv_string = @organization.ticket_sales.all.to_comma(:ticket_sale) send_data @csv_string, :filename => @filename, :type => "text/csv", :disposition => "attachment" end |