Skip to content

Instantly share code, notes, and snippets.

@joemsak
Created October 19, 2012 16:33
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save joemsak/e644ea58745bb31d661b to your computer and use it in GitHub Desktop.
Save joemsak/e644ea58745bb31d661b to your computer and use it in GitHub Desktop.
# coding: utf-8
class PackingSlip < Prawn::Document
# recognized options
# :needs_cover_page => true|false
def initialize(orders, options = {})
super(:page_layout => :portrait)
@orders = orders
@options = options
default_leading 5
cover_page if cover_page_needed?
@orders.each do |order|
order_page(order)
start_new_page unless order == orders.last
end
end
# ...
end
@pikender
Copy link

Can you please also include the structure of order_page(order) here ?

Would make it complete ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment