Module: Ramaze::Helper::XHTML
- Defined in:
- lib/ramaze/helper/xhtml.rb
Instance Method Summary collapse
- #css(name, media = 'screen', options = {}) ⇒ Object
- #css_for(*names) ⇒ Object
- #js(name) ⇒ Object
- #js_for(*names) ⇒ Object
Instance Method Details
#css(name, media = 'screen', options = {}) ⇒ Object
3 4 5 6 7 8 9 |
# File 'lib/ramaze/helper/xhtml.rb', line 3 def css(name, media = 'screen', = {}) if .empty? "<link rel='stylesheet' href='/css/#{name}.css' type='text/css' media='#{media}' />" elsif [:only] == 'IE' "<!--[if IE]>#{css(name, media)}<![endif]-->" end end |
#css_for(*names) ⇒ Object
11 12 13 |
# File 'lib/ramaze/helper/xhtml.rb', line 11 def css_for(*names) names.flatten.map{|name| css(name) }.join("\n") end |
#js(name) ⇒ Object
15 16 17 |
# File 'lib/ramaze/helper/xhtml.rb', line 15 def js(name) "<script src='/js/#{name}.js' type='text/javascript'></script>" end |
#js_for(*names) ⇒ Object
19 20 21 |
# File 'lib/ramaze/helper/xhtml.rb', line 19 def js_for(*names) names.flatten.map{|name| js(name) }.join("\n") end |