Class: YDIM::Html::View::Pdf

Inherits:
HtmlGrid::Component show all
Defined in:
lib/ydim/html/view/pdf.rb

Constant Summary

Constants inherited from HtmlGrid::Component

HtmlGrid::Component::HTTP_HEADERS

Instance Method Summary collapse

Methods inherited from HtmlGrid::Component

#escape, escaped, #format, links, #number_format, #precision

Instance Method Details

#http_headers(*args) ⇒ Object



14
15
16
17
18
19
# File 'lib/ydim/html/view/pdf.rb', line 14

def http_headers(*args)
	super.update(
		'Content-Type'				=>	'application/pdf',
		'Content-Disposition' =>  "attachment; filename=#{@model.unique_id}.pdf"
	)
end

#to_html(context) ⇒ Object



10
11
12
13
# File 'lib/ydim/html/view/pdf.rb', line 10

def to_html(context)
  @model.to_pdf :sortby => (@session.state.sortby || []).first,
                :sort_reverse => @session.state.sort_reverse
end