Module: GTK::AssetsHelper
- Defined in:
- lib/gtk_webkit_pdf/gtk_views_helper_pdf.rb
Instance Method Summary collapse
- #gtk_webkit_pdf_image_tag(img, options = {}) ⇒ Object
- #gtk_webkit_pdf_javascript_include_tag(*sources) ⇒ Object
- #gtk_webkit_pdf_javascript_src_tag(jsfile, options = {}) ⇒ Object
- #gtk_webkit_pdf_stylesheet_link_tag(*sources) ⇒ Object
Instance Method Details
#gtk_webkit_pdf_image_tag(img, options = {}) ⇒ Object
32 33 34 |
# File 'lib/gtk_webkit_pdf/gtk_views_helper_pdf.rb', line 32 def gtk_webkit_pdf_image_tag(img, ={}) image_tag("file://#{asset_pathname(img).to_s}", ) end |
#gtk_webkit_pdf_javascript_include_tag(*sources) ⇒ Object
40 41 42 |
# File 'lib/gtk_webkit_pdf/gtk_views_helper_pdf.rb', line 40 def gtk_webkit_pdf_javascript_include_tag(*sources) sources.collect { |source| "<script type='text/javascript'>#{read_asset(source+".js")}</script>" }.join('\n').html_safe end |
#gtk_webkit_pdf_javascript_src_tag(jsfile, options = {}) ⇒ Object
36 37 38 |
# File 'lib/gtk_webkit_pdf/gtk_views_helper_pdf.rb', line 36 def gtk_webkit_pdf_javascript_src_tag(jsfile, ={}) javascript_include_tag("file:///#{asset_pathname(jsfile).to_s}", ) end |
#gtk_webkit_pdf_stylesheet_link_tag(*sources) ⇒ Object
28 29 30 |
# File 'lib/gtk_webkit_pdf/gtk_views_helper_pdf.rb', line 28 def gtk_webkit_pdf_stylesheet_link_tag(*sources) sources.collect { |source| "<style type='text/css'>#{read_asset(source+".css")}</style>" }.join('\n').html_safe end |