Sha256: 8202cf9139fd83331aaa73c55ee60ac89b42a0438987147a5c5a4c907cba2633

Contents?: true

Size: 743 Bytes

Versions: 3

Compression:

Stored size: 743 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,
module LayoutHelper
  def title(page_title, show_title = true)
    content_for(:title) { h(page_title.to_s) }
    @show_title = show_title
  end

  def show_title?
    @show_title
  end

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

  def description(page_description, show_description = true)
    content_for(:description) { h(page_description.to_s) }
  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 & 1 rubygems

Version Path
dust-cms-0.0.07 app/helpers/layout_helper.rb
dust-cms-0.0.06 app/helpers/layout_helper.rb
dust-cms-0.0.05 app/helpers/layout_helper.rb