Class: Erector::Widget
Instance Method Summary (collapse)
-
- (Object) css(href, args = {})
Generate a stylesheet tag.
-
- (Object) ie_if(expr, &block)
Generate a pair of conditional tags for a specific browser.
-
- (Object) inspect(elem)
Inspect the specified element.
-
- (Object) js(src)
Generate a Javascript tag.
- - (Object) old_css
-
- (Object) strict_xhtml(*args, &block)
Method that generates a XHTML 1.0 Strict doctype.
Instance Method Details
- (Object) css(href, args = {})
Generate a stylesheet tag.
105 106 107 108 109 110 111 112 113 |
# File 'lib/ramaze/helper/erector.rb', line 105 def css(href, args = {}) attrs = { :rel => "stylesheet", :href => href, :type => "text/css" }.merge(args) link attrs end |
- (Object) ie_if(expr, &block)
Generate a pair of conditional tags for a specific browser.
78 79 80 81 82 |
# File 'lib/ramaze/helper/erector.rb', line 78 def ie_if(expr, &block) raw! "<!--[if #{expr}]>" yield raw! "<![endif]-->" end |
- (Object) inspect(elem)
Inspect the specified element.
89 90 91 |
# File 'lib/ramaze/helper/erector.rb', line 89 def inspect(elem) text elem.inspect end |
- (Object) js(src)
Generate a Javascript tag.
61 62 63 |
# File 'lib/ramaze/helper/erector.rb', line 61 def js(src) script :src => src end |
- (Object) old_css
23 |
# File 'lib/ramaze/helper/erector.rb', line 23 alias :old_css :css |
- (Object) strict_xhtml(*args, &block)
Method that generates a XHTML 1.0 Strict doctype.
46 47 48 49 50 |
# File 'lib/ramaze/helper/erector.rb', line 46 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 |