Module: GoStaticHelper::Assets
- Defined in:
- lib/go_static_helper.rb
Instance Method Summary collapse
- #go_static_image_tag(img, options = {}) ⇒ Object
- #go_static_javascript_include_tag(*sources) ⇒ Object
- #go_static_javascript_src_tag(jsfile, options = {}) ⇒ Object
- #go_static_stylesheet_link_tag(*sources) ⇒ Object
Instance Method Details
#go_static_image_tag(img, options = {}) ⇒ Object
28 29 30 |
# File 'lib/go_static_helper.rb', line 28 def go_static_image_tag(img, ={}) image_tag "file://#{asset_pathname(img).to_s}", end |
#go_static_javascript_include_tag(*sources) ⇒ Object
36 37 38 39 40 |
# File 'lib/go_static_helper.rb', line 36 def go_static_javascript_include_tag(*sources) sources.collect { |source| "<script type='text/javascript'>#{read_asset(source+".js")}</script>" }.join("\n").html_safe end |
#go_static_javascript_src_tag(jsfile, options = {}) ⇒ Object
32 33 34 |
# File 'lib/go_static_helper.rb', line 32 def go_static_javascript_src_tag(jsfile, ={}) javascript_include_tag "file://#{asset_pathname(jsfile).to_s}", end |
#go_static_stylesheet_link_tag(*sources) ⇒ Object
22 23 24 25 26 |
# File 'lib/go_static_helper.rb', line 22 def go_static_stylesheet_link_tag(*sources) sources.collect { |source| "<style type='text/css'>#{read_asset(source+".css")}</style>" }.join("\n").html_safe end |