Module: Html5BoilerplateHelper
- Defined in:
- lib/app/helpers/html5_boilerplate_helper.rb
Instance Method Summary collapse
- #google_account_id ⇒ Object
- #google_api_key ⇒ Object
- #ie_body(attrs = {}, &block) ⇒ Object
- #ie_html(attrs = {}, &block) ⇒ Object
-
#ie_tag(name = :body, attrs = {}, &block) ⇒ Object
Create a named haml tag to wrap IE conditional around a block paulirish.com/2008/conditional-stylesheets-vs-css-hacks-answer-neither.
Instance Method Details
#google_account_id ⇒ Object
25 26 27 |
# File 'lib/app/helpers/html5_boilerplate_helper.rb', line 25 def google_account_id ENV['GOOGLE_ACCOUNT_ID'] || google_config(:google_account_id) || '' end |
#google_api_key ⇒ Object
29 30 31 |
# File 'lib/app/helpers/html5_boilerplate_helper.rb', line 29 def google_api_key ENV['GOOGLE_API_KEY'] || google_config(:google_api_key) || '' end |
#ie_body(attrs = {}, &block) ⇒ Object
21 22 23 |
# File 'lib/app/helpers/html5_boilerplate_helper.rb', line 21 def ie_body(attrs={}, &block) ie_tag(:body, attrs, &block) end |
#ie_html(attrs = {}, &block) ⇒ Object
17 18 19 |
# File 'lib/app/helpers/html5_boilerplate_helper.rb', line 17 def ie_html(attrs={}, &block) ie_tag(:html, attrs, &block) end |
#ie_tag(name = :body, attrs = {}, &block) ⇒ Object
Create a named haml tag to wrap IE conditional around a block paulirish.com/2008/conditional-stylesheets-vs-css-hacks-answer-neither
4 5 6 7 8 9 10 11 12 13 14 15 |
# File 'lib/app/helpers/html5_boilerplate_helper.rb', line 4 def ie_tag(name=:body, attrs={}, &block) attrs.symbolize_keys! haml_concat("<!--[if lt IE 7 ]> #{ tag(name, add_class('ie6', attrs), true) } <![endif]-->".html_safe) haml_concat("<!--[if IE 7 ]> #{ tag(name, add_class('ie7', attrs), true) } <![endif]-->".html_safe) haml_concat("<!--[if IE 8 ]> #{ tag(name, add_class('ie8', attrs), true) } <![endif]-->".html_safe) haml_concat("<!--[if IE 9 ]> #{ tag(name, add_class('ie9', attrs), true) } <![endif]-->".html_safe) haml_concat("<!--[if (gt IE 9)|!(IE)]><!-->".html_safe) haml_tag name, attrs do haml_concat("<!--<![endif]-->".html_safe) block.call end end |