Module: GoStaticHelper
- Defined in:
- lib/go_static_helper.rb
Defined Under Namespace
Modules: Assets
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
9 10 11 |
# File 'lib/go_static_helper.rb', line 9 def go_static_image_tag(img, ={}) image_tag "file:///#{Rails.root.join('public', 'images', img)}", end |
#go_static_javascript_include_tag(*sources) ⇒ Object
17 18 19 |
# File 'lib/go_static_helper.rb', line 17 def go_static_javascript_include_tag(*sources) sources.collect{ |source| go_static_javascript_src_tag(source, {}) }.join("\n").html_safe end |
#go_static_javascript_src_tag(jsfile, options = {}) ⇒ Object
13 14 15 |
# File 'lib/go_static_helper.rb', line 13 def go_static_javascript_src_tag(jsfile, ={}) javascript_src_tag "file:///#{Rails.root.join('public','javascripts',jsfile)}", end |
#go_static_stylesheet_link_tag(*sources) ⇒ Object
2 3 4 5 6 7 |
# File 'lib/go_static_helper.rb', line 2 def go_static_stylesheet_link_tag(*sources) css_dir = Rails.root.join('public','stylesheets') sources.collect { |source| "<style type='text/css'>#{File.read(css_dir.join(source+'.css'))}</style>" }.join("\n").html_safe end |