Module: LayoutHelper

Defined in:
lib/generators/lab/setup/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(*files) ⇒ Object

allows the inclusion of javascript files in the <head> section for specific views



7
8
9
# File 'lib/generators/lab/setup/templates/layout_helper.rb', line 7

def javascript(*files)
  content_for(:head, javascript_include_tag(*files))
end

#stylesheet(*files) ⇒ Object

allows the inclusion of css files in the <head> section for specific views



12
13
14
# File 'lib/generators/lab/setup/templates/layout_helper.rb', line 12

def stylesheet(*files)
  content_for(:head, stylesheet_link_tag(*files))
end

#title(page_title) ⇒ Object

change the <title> for specific views



17
18
19
# File 'lib/generators/lab/setup/templates/layout_helper.rb', line 17

def title(page_title)
  content_for(:title, page_title)
end