Module: ActivesupportOverride
- Included in:
- EasyHtmlGenerator::Generator::Compile::Haml::Context
- Defined in:
- lib/easy_html_generator/generator/compile/haml/helper/activesupport_override.rb
Overview
this module overrides some active support methods for working paths etc.
Instance Method Summary collapse
- #javascript_include_tag(path) ⇒ Object
- #link_tag(source, relation, type = '') ⇒ Object
- #meta_tag(type, content) ⇒ Object
- #meta_tag_http(type, content) ⇒ Object
- #path_to_css(path) ⇒ Object
- #path_to_image(path) ⇒ Object
- #path_to_js(path) ⇒ Object
- #stylesheet_link_tag(path, media = 'screen') ⇒ Object
Instance Method Details
#javascript_include_tag(path) ⇒ Object
10 11 12 |
# File 'lib/easy_html_generator/generator/compile/haml/helper/activesupport_override.rb', line 10 def javascript_include_tag(path) '<script src="' + path_to_js(path) + '"></script>' end |
#link_tag(source, relation, type = '') ⇒ Object
22 23 24 25 |
# File 'lib/easy_html_generator/generator/compile/haml/helper/activesupport_override.rb', line 22 def link_tag(source, relation, type = '') type = " type='#{type}'" if type '<link rel="' + relation + '" href="' + source + '"' + type + '/>' end |
#meta_tag(type, content) ⇒ Object
14 15 16 |
# File 'lib/easy_html_generator/generator/compile/haml/helper/activesupport_override.rb', line 14 def (type, content) '<meta name="' + type + '" content="' + content + '" />' end |
#meta_tag_http(type, content) ⇒ Object
18 19 20 |
# File 'lib/easy_html_generator/generator/compile/haml/helper/activesupport_override.rb', line 18 def (type, content) '<meta http-equiv="' + type + '" content="' + content + '" />' end |
#path_to_css(path) ⇒ Object
27 28 29 30 |
# File 'lib/easy_html_generator/generator/compile/haml/helper/activesupport_override.rb', line 27 def path_to_css(path) return path if external_path?(path) @project.uri_path_to(:styles, path) end |
#path_to_image(path) ⇒ Object
37 38 39 40 |
# File 'lib/easy_html_generator/generator/compile/haml/helper/activesupport_override.rb', line 37 def path_to_image(path) return path if external_path? path @project.uri_path_to(:images, path) end |
#path_to_js(path) ⇒ Object
32 33 34 35 |
# File 'lib/easy_html_generator/generator/compile/haml/helper/activesupport_override.rb', line 32 def path_to_js(path) return path if external_path? path @project.uri_path_to(:scripts, path) end |
#stylesheet_link_tag(path, media = 'screen') ⇒ Object
5 6 7 8 |
# File 'lib/easy_html_generator/generator/compile/haml/helper/activesupport_override.rb', line 5 def stylesheet_link_tag(path, media = 'screen') '<link href="' + path_to_css(path) + '" media="' + media + '" rel="stylesheet" type="text/css" />' end |