module ActivesupportOverride
Public Instance Methods
external_path?(path)
click to toggle source
# File lib/generator/helper/activesupport_override.rb, line 41 def external_path? path path.start_with?('//') || path.start_with?('http') end
javascript_include_tag(path)
click to toggle source
# File lib/generator/helper/activesupport_override.rb, line 6 def javascript_include_tag(path) '<script src="'+path_to_js(path)+'"></script>' end
link_tag(source, relation, type='')
click to toggle source
# File lib/generator/helper/activesupport_override.rb, line 18 def link_tag(source, relation, type='') type = " type='#{type}'" if type '<link rel="'+relation+'" href="'+source+'"'+type+'/>' end
meta_tag(type, content)
click to toggle source
# File lib/generator/helper/activesupport_override.rb, line 10 def meta_tag(type, content) '<meta name="'+type+'" content="'+content+'" />' end
meta_tag_http(type, content)
click to toggle source
# File lib/generator/helper/activesupport_override.rb, line 14 def meta_tag_http(type, content) '<meta http-equiv="'+type+'" content="'+content+'" />' end
path_to_css(path)
click to toggle source
# File lib/generator/helper/activesupport_override.rb, line 23 def path_to_css(path) return path if external_path?(path) return "css/#{path}" if file_exists? "css/#{path}" path end
path_to_image(path)
click to toggle source
# File lib/generator/helper/activesupport_override.rb, line 35 def path_to_image(path) return path if external_path? path return "images/#{path}" if file_exists? "images/#{path}" path end
path_to_js(path)
click to toggle source
# File lib/generator/helper/activesupport_override.rb, line 29 def path_to_js(path) return path if external_path? path return "js/#{path}" if file_exists? "js/#{path}" path end
stylesheet_link_tag(path, media='screen')
click to toggle source
# File lib/generator/helper/activesupport_override.rb, line 2 def stylesheet_link_tag(path, media='screen') '<link href="'+path_to_css(path)+'" media="'+media+'" rel="stylesheet" type="text/css" />' end
url_for(options = '')
click to toggle source
# File lib/generator/helper/activesupport_override.rb, line 45 def url_for(options = '') return options end