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

Instance Method Details

#javascript_include_tag(path) ⇒ Object



5
6
7
# File 'lib/easy_html_generator/generator/compile/haml/helper/activesupport_override.rb', line 5

def javascript_include_tag(path)
  '<script src="' + path_to_js(path) + '"></script>'
end


17
18
19
20
# File 'lib/easy_html_generator/generator/compile/haml/helper/activesupport_override.rb', line 17

def link_tag(source, relation, type = '')
  type = " type='#{type}'" if type
  '<link rel="' + relation + '" href="' + source + '"' + type + '/>'
end

#meta_tag(type, content) ⇒ Object



9
10
11
# File 'lib/easy_html_generator/generator/compile/haml/helper/activesupport_override.rb', line 9

def meta_tag(type, content)
  '<meta name="' + type + '" content="' + content + '" />'
end

#meta_tag_http(type, content) ⇒ Object



13
14
15
# File 'lib/easy_html_generator/generator/compile/haml/helper/activesupport_override.rb', line 13

def meta_tag_http(type, content)
  '<meta http-equiv="' + type + '" content="' + content + '" />'
end

#path_to_image(path) ⇒ Object



32
33
34
35
# File 'lib/easy_html_generator/generator/compile/haml/helper/activesupport_override.rb', line 32

def path_to_image(path)
  return path if external_path? path
  @project.uri_path_to(:images, path)
end

#path_to_js(path) ⇒ Object



27
28
29
30
# File 'lib/easy_html_generator/generator/compile/haml/helper/activesupport_override.rb', line 27

def path_to_js(path)
  return path if external_path? path
  @project.uri_path_to(:scripts, path)
end

#path_to_stylesheet(path, _options = {}) ⇒ Object



22
23
24
25
# File 'lib/easy_html_generator/generator/compile/haml/helper/activesupport_override.rb', line 22

def path_to_stylesheet(path, _options = {})
  return path if external_path?(path)
  @project.uri_path_to(:styles, path)
end