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,

Instance Method Summary collapse

Instance Method Details

#description(page_description, show_description = true) ⇒ Object



17
18
19
# File 'app/helpers/layout_helper.rb', line 17

def description(page_description, show_description = true)
  content_for(:description) { h(page_description.to_s) }
end

#heading(page_title, show_title = true) ⇒ Object



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

def heading(page_title, show_title = true)
  content_for(:heading) { h(page_title.to_s) }
end

#javascript(*args) ⇒ Object



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

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

#show_title?Boolean

Returns:

  • (Boolean)


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

def show_title?
  @show_title
end

#stylesheet(*args) ⇒ Object



21
22
23
# File 'app/helpers/layout_helper.rb', line 21

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

#title(page_title, show_title = true) ⇒ Object



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

def title(page_title, show_title = true)
  content_for(:title) { h(page_title.to_s) }
  @show_title = show_title
end