Module: LayoutHelper

Defined in:
lib/generators/niftier/layout/templates/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

#javascript(*args) ⇒ Object



19
20
21
# File 'lib/generators/niftier/layout/templates/layout_helper.rb', line 19

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

#onload(str) ⇒ Object



23
24
25
# File 'lib/generators/niftier/layout/templates/layout_helper.rb', line 23

def onload(str)
  content_for(:onload_scripts) { str + "\n" }
end

#show_title?Boolean



11
12
13
# File 'lib/generators/niftier/layout/templates/layout_helper.rb', line 11

def show_title?
  @show_title
end

#stylesheet(*args) ⇒ Object



15
16
17
# File 'lib/generators/niftier/layout/templates/layout_helper.rb', line 15

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

#title(page_title, show_title = true) ⇒ Object



6
7
8
9
# File 'lib/generators/niftier/layout/templates/layout_helper.rb', line 6

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