Module: LayoutHelper

Defined in:
app/helpers/layout_helper.rb

Overview

These helper methods can be called in your template to set variables to be used in the layout This module should be included in all views globally, to do so you may need to add this line to your ApplicationController

helper :layout

Instance Method Summary collapse

Instance Method Details

#description(description) ⇒ Object



14
15
16
# File 'app/helpers/layout_helper.rb', line 14

def description(description)
  @content_for_description = description
end

#javascript(*args) ⇒ Object



34
35
36
# File 'app/helpers/layout_helper.rb', line 34

def javascript(*args)
  content_for(:head) { javascript_include_tag(*args) }
end

#keywords(keywords) ⇒ Object



10
11
12
# File 'app/helpers/layout_helper.rb', line 10

def keywords(keywords)
  @content_for_keywords = keywords
end

#render_seo(index) ⇒ Object



24
25
26
27
28
# File 'app/helpers/layout_helper.rb', line 24

def render_seo(index)
  title index.page_title unless index.page_title.blank?
  keywords index.keywords unless index.keywords.blank?
  description index.page_description unless index.page_description.blank?
end

#render_side_section(section) ⇒ Object



18
19
20
21
22
# File 'app/helpers/layout_helper.rb', line 18

def render_side_section(section)
  content_for(:side_section) {
    render :partial => 'application/side_section', :locals => {:section => section}
  }
end

#stylesheet(*args) ⇒ Object



30
31
32
# File 'app/helpers/layout_helper.rb', line 30

def stylesheet(*args)
  content_for(:head) { stylesheet_link_tag(*args) }
end

#title(page_title) ⇒ Object



6
7
8
# File 'app/helpers/layout_helper.rb', line 6

def title(page_title)
  @content_for_title = page_title.to_s
end