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



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

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

#to_html(context) ⇒ Object



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

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