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 Consider adding an manifest.appcache: h5bp.com/d/Offline



5
6
7
8
9
10
11
12
13
14
15
# File 'lib/app/helpers/html5_boilerplate_helper.rb', line 5

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 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 'lib/app/helpers/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 'lib/app/helpers/html5_boilerplate_helper.rb', line 33

def remote_jquery(version)
  if Rails.env == 'development'
    "'jquery', '#{version}', {uncompressed:true}"
  else
    "'jquery', '#{version}'"
  end
end