Module: ApplicationHelper

Defined in:
lib/generators/new_site_files/templates/app_helper.rb

Instance Method Summary collapse

Instance Method Details

#header(name, content) ⇒ Object

Add some data inside the HTML header; must have corresponding content_for?(:foo) ? yield(:foo) : ‘default’ inside layout. Defaults – :title, :keywords, :description Example

header(:title, "Administration Functions")


8
9
10
11
12
13
# File 'lib/generators/new_site_files/templates/app_helper.rb', line 8

def header(name, content)
  case name
  when :title then content_for :header_title do "#{content} : #{company_name}" end
  else             content_for name do content end
  end
end

#page_title(page_title) ⇒ Object

Page title inside the body at the top of the main content section Example:

page_title("Administration Functions")


18
19
20
21
22
23
24
# File 'lib/generators/new_site_files/templates/app_helper.rb', line 18

def page_title(page_title)
  unless page_title.blank?
    content_for :page_title do
      (:h1, page_title, :id => 'page_title')
    end
  end
end