Module: Sinatra::Prawn::Helpers
- Defined in:
- lib/sinatra/prawn.rb
Instance Method Summary collapse
-
#prawn(template = nil, options = {}, locals = {}, &block) ⇒ Object
Generate pdf file using Prawn.
Instance Method Details
#prawn(template = nil, options = {}, locals = {}, &block) ⇒ Object
Generate pdf file using Prawn. Takes the name of a template to render as a Symbol and returns a String with the rendered output.
Options for prawn may be specified in Sinatra using set :prawn, { … }
10 11 12 13 14 15 |
# File 'lib/sinatra/prawn.rb', line 10 def prawn(template=nil, ={}, locals = {}, &block) , template = template, nil if template.is_a?(Hash) template = lambda { block } if template.nil? [:layout] = false render :prawn, template, , locals end |