Sha256: d0093012ad7e132b2a1e5436066a70e0da52674d818670990c8b2a564723d094

Contents?: true

Size: 697 Bytes

Versions: 3

Compression:

Stored size: 697 Bytes

Contents

# 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
module LayoutHelper
  def title(page_title, show_title = true)
    content_for(:title) { page_title.to_s }
    @show_title = show_title
  end
  
  def show_title?
    @show_title
  end
  
  def stylesheet(*args)
    content_for(:stylesheets) { stylesheet_link_tag(*args) }
  end
  
  def javascript(*args)
    content_for(:javascripts) { javascript_include_tag(*args) }
  end
  
  def onload(str)
    content_for(:onload_scripts) { str + "\n" }
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
niftier-generators-0.1.2 lib/generators/niftier/layout/templates/layout_helper.rb
niftier-generators-0.1.1 lib/generators/niftier/layout/templates/layout_helper.rb
niftier-generators-0.1.0 lib/generators/niftier/layout/templates/layout_helper.rb