Module: ActivesupportOverride
- Included in:
- Generator::Context
- Defined in:
- lib/generator/helper/activesupport_override.rb
Instance Method Summary (collapse)
- - (Boolean) external_path?(path)
- - (Object) 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) url_for(options = '')
Instance Method Details
- (Boolean) external_path?(path)
39 40 41 |
# File 'lib/generator/helper/activesupport_override.rb', line 39 def external_path? path path.start_with?('//') || path.start_with?('http') end |
- (Object) javascript_include_tag(path)
8 9 10 |
# File 'lib/generator/helper/activesupport_override.rb', line 8 def javascript_include_tag(path) '<script src="'+path_to_js(path)+'"></script>' end |
- (Object) link_tag(source, relation, type)
20 21 22 |
# File 'lib/generator/helper/activesupport_override.rb', line 20 def link_tag(source, relation, type) '<link rel="'+relation+'" href="'+source+'" type="'+type+'" />' end |
- (Object) meta_tag(type, content)
12 13 14 |
# File 'lib/generator/helper/activesupport_override.rb', line 12 def (type, content) '<meta name="'+type+'" content="'+content+'" />' end |
- (Object) meta_tag_http(type, content)
16 17 18 |
# File 'lib/generator/helper/activesupport_override.rb', line 16 def (type, content) '<meta http-equiv="'+type+'" content="'+content+'" />' end |
- (Object) path_to_css(path)
24 25 26 27 |
# File 'lib/generator/helper/activesupport_override.rb', line 24 def path_to_css(path) return path if external_path?(path) "css/#{path}" end |
- (Object) path_to_image(path)
34 35 36 37 |
# File 'lib/generator/helper/activesupport_override.rb', line 34 def path_to_image(path) return path if external_path? path "images/#{path}" end |
- (Object) path_to_js(path)
29 30 31 32 |
# File 'lib/generator/helper/activesupport_override.rb', line 29 def path_to_js(path) return path if external_path? path "js/#{path}" end |
- (Object) stylesheet_link_tag(path, media = 'screen')
4 5 6 |
# File 'lib/generator/helper/activesupport_override.rb', line 4 def stylesheet_link_tag(path, media='screen') '<link href="'+path_to_css(path)+'" media="'+media+'" rel="stylesheet" type="text/css" />' end |
- (Object) url_for(options = '')
43 44 45 |
# File 'lib/generator/helper/activesupport_override.rb', line 43 def url_for( = '') return end |