Module: ApplicationHelper

Defined in:
lib/generators/wrstart/template/application_helper.rb

Instance Method Summary collapse

Instance Method Details

#body_class(class_name = "home") ⇒ Object



3
4
5
# File 'lib/generators/wrstart/template/application_helper.rb', line 3

def body_class(class_name="home")
  content_for :body_class, class_name
end

#responsive_image(image_bg, coverable = true) ⇒ Object



7
8
9
10
11
12
13
14
# File 'lib/generators/wrstart/template/application_helper.rb', line 7

def responsive_image(image_bg, coverable=true)
  html = ''
  html << "<div class='image_bg' style='background:url("+ image_url(image_bg) +") no-repeat center; width: 100%; height: 100%;"
  html << "background-size: cover;" if coverable
  html << "'></div>"

  return raw html
end