Sha256: 87ba3542f327383a91336f73be9570ff26da185f514e5458abb2ca7ec76fb9dd

Contents?: true

Size: 608 Bytes

Versions: 3

Compression:

Stored size: 608 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(:head) { stylesheet_link_tag(*args) }
  end
  
  def javascript(*args)
    content_for(:head) { javascript_include_tag(*args) }
  end
end

Version data entries

3 entries across 3 versions & 2 rubygems

Version Path
corntrace-nifty-generators-0.4.1 lib/generators/nifty/layout/templates/layout_helper.rb
corntrace-nifty-generators-0.4.0 lib/generators/nifty/layout/templates/layout_helper.rb
nifty-generators-0.4.0 lib/generators/nifty/layout/templates/layout_helper.rb