Class: Erector::Widget
- Inherits:
-
Object
- Object
- Erector::Widget
- Defined in:
- lib/ramaze/helper/erector.rb
Instance Method Summary collapse
-
#css(href, args = {}) ⇒ Object
Generate a stylesheet tag.
-
#ie_if(expr, &block) ⇒ Object
Generate a pair of conditional tags for a specific browser.
-
#inspect(elem) ⇒ Object
Inspect the specified element.
-
#js(src) ⇒ Object
Generate a Javascript tag.
- #old_css ⇒ Object
-
#strict_xhtml(*args, &block) ⇒ Object
Method that generates a XHTML 1.0 Strict doctype.
Instance Method Details
#css(href, args = {}) ⇒ Object
Generate a stylesheet tag.
101 102 103 104 105 106 107 108 109 |
# File 'lib/ramaze/helper/erector.rb', line 101 def css(href, args = {}) attrs = { :rel => "stylesheet", :href => href, :type => "text/css" }.merge(args) link attrs end |
#ie_if(expr, &block) ⇒ Object
Generate a pair of conditional tags for a specific browser.
75 76 77 78 79 |
# File 'lib/ramaze/helper/erector.rb', line 75 def ie_if(expr, &block) raw! "<!--[if #{expr}]>" yield raw! "<![endif]-->" end |
#inspect(elem) ⇒ Object
Inspect the specified element.
86 87 88 |
# File 'lib/ramaze/helper/erector.rb', line 86 def inspect(elem) text elem.inspect end |
#js(src) ⇒ Object
Generate a Javascript tag.
59 60 61 |
# File 'lib/ramaze/helper/erector.rb', line 59 def js(src) script :src => src end |
#old_css ⇒ Object
23 |
# File 'lib/ramaze/helper/erector.rb', line 23 alias :old_css :css |
#strict_xhtml(*args, &block) ⇒ Object
Method that generates a XHTML 1.0 Strict doctype.
45 46 47 48 49 |
# File 'lib/ramaze/helper/erector.rb', line 45 def strict_xhtml(*args, &block) raw! '<?xml version="1.0" encoding="UTF-8"?>' raw! '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "DTD/xhtml1-strict.dtd">' html(:xmlns => "http://www.w3.org/1999/xhtml", :"xml:lang" => "en", :lang => "en", &block) end |