Module: Html5BoilerplateHelper

Defined in:
lib/app/helpers/html5_boilerplate_helper.rb

Instance Method Summary collapse

Instance Method Details

#google_account_idObject



25
26
27
# File 'lib/app/helpers/html5_boilerplate_helper.rb', line 25

def 
  ENV['GOOGLE_ACCOUNT_ID'] || google_config(:google_account_id) || ''
end

#google_api_keyObject



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