Module: PageHelper

Defined in:
lib/generators/sushi/templates/page_helper.rb

Instance Method Summary collapse

Instance Method Details

#meta_desc(desc) ⇒ Object



10
11
12
# File 'lib/generators/sushi/templates/page_helper.rb', line 10

def meta_desc(desc)
  content_for(:meta_desc) { desc.to_s }
end

#meta_keywords(desc) ⇒ Object



14
15
16
# File 'lib/generators/sushi/templates/page_helper.rb', line 14

def meta_keywords(desc)
  content_for(:meta_keywords) { desc.to_s }
end


22
23
24
25
26
27
28
29
# File 'lib/generators/sushi/templates/page_helper.rb', line 22

def nav_link(page)
  # link_to page.titleize, page_path(page.downcase), :id => page
  if page.nav_path == ""
    link_to page.link, '#'
  else
    link_to page.link, link_path(page.root.name, page.nav_path)
  end
end

#page_name(name) ⇒ Object



6
7
8
# File 'lib/generators/sushi/templates/page_helper.rb', line 6

def page_name(name)
  content_for(:page_name) { name.to_s }
end


18
19
20
# File 'lib/generators/sushi/templates/page_helper.rb', line 18

def sidebar(content)
  content_for(:sidebar) { content.to_s }
end

#title(page_title) ⇒ Object



2
3
4
# File 'lib/generators/sushi/templates/page_helper.rb', line 2

def title(page_title)
  content_for(:title) { page_title.to_s + " | Application Name" }
end