Created
August 7, 2012 03:04
-
-
Save mculp/3280963 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| def show | |
| begin | |
| month = Date.parse(params[:month]) | |
| rescue | |
| flash[:error] = 'Invalid date.' | |
| redirect_to admin_reports_path and return | |
| end | |
| @auctions = Auction.completed.where("updated_at > ? and updated_at <= ?", month, month.end_of_month) | |
| @headers = [ | |
| "ID", "Nonprofit", "Payee Name", "Nonprofit Phone", "Nonprofit address 1", "Nonprofit address 2", "Nonprofit City", | |
| "Nonprofit State", "Nonprofit ZIP", "Auction City", "Auction State", "Auction Zip", "Auction Name", "Amount ($)" | |
| ] | |
| respond_to do |format| | |
| format.xls { send_data render_to_string('report') } | |
| end | |
| end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment