Module: WickedPdfHelper::Assets

Defined in:
lib/wicked_pdf_helper.rb

Instance Method Summary collapse

Instance Method Details

#wicked_pdf_image_tag(img, options = {}) ⇒ Object



46
47
48
# File 'lib/wicked_pdf_helper.rb', line 46

def wicked_pdf_image_tag(img, options={})
  image_tag "file://#{asset_pathname(img).to_s}", options
end

#wicked_pdf_javascript_include_tag(*sources) ⇒ Object



54
55
56
57
58
# File 'lib/wicked_pdf_helper.rb', line 54

def wicked_pdf_javascript_include_tag(*sources)
  sources.collect { |source|
    "<script type='text/javascript'>#{read_asset(source+".js")}</script>"
  }.join("\n").html_safe
end

#wicked_pdf_javascript_src_tag(jsfile, options = {}) ⇒ Object



50
51
52
# File 'lib/wicked_pdf_helper.rb', line 50

def wicked_pdf_javascript_src_tag(jsfile, options={})
  javascript_include_tag "file://#{asset_pathname(jsfile).to_s}", options
end


40
41
42
43
44
# File 'lib/wicked_pdf_helper.rb', line 40

def wicked_pdf_stylesheet_link_tag(*sources)
  sources.collect { |source|
    "<style type='text/css'>#{read_asset(source+".css")}</style>"
  }.join("\n").html_safe
end