Module: Console::Html5BoilerplateHelper
- Defined in:
- app/helpers/console/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.
- #local_jquery(version) ⇒ Object
- #remote_jquery(version) ⇒ Object
Instance Method Details
#google_account_id ⇒ Object
25 26 27 |
# File 'app/helpers/console/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 'app/helpers/console/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 'app/helpers/console/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 'app/helpers/console/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 'app/helpers/console/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 8]><!-->".html_safe) haml_tag name, attrs do haml_concat("<!--<![endif]-->".html_safe) block.call end end |
#local_jquery(version) ⇒ Object
41 42 43 44 45 46 47 |
# File 'app/helpers/console/html5_boilerplate_helper.rb', line 41 def local_jquery(version) if Rails.env == 'development' "#{version}/jquery.js" else "#{version}/jquery.min.js" end end |
#remote_jquery(version) ⇒ Object
33 34 35 36 37 38 39 |
# File 'app/helpers/console/html5_boilerplate_helper.rb', line 33 def remote_jquery(version) if Rails.env == 'development' "'jquery', '#{version}', {uncompressed:true}" else "'jquery', '#{version}'" end end |