Skip to content

Instantly share code, notes, and snippets.

@jnstq
Created November 9, 2011 22:42
Show Gist options
  • Save jnstq/1353394 to your computer and use it in GitHub Desktop.
Save jnstq/1353394 to your computer and use it in GitHub Desktop.
class TicketsController < ApplicationController
def index
@order = Order.paid.find_by_permalink!(params[:user_order_id])
ticket_report = TicketReport.new
ticket_report.order = @order
respond_to do |format|
format.pdf do
send_data ticket_report.to_pdf, :filename => "Biljetter-#{@order.permalink}.pdf",
:type => "application/pdf",
:disposition => "attachment"
end
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment