Sha256: b262e6e00db8ee4ca9e44512e61bc8a789876116b09caefe28c8f0dcfba9494a

Contents?: true

Size: 724 Bytes

Versions: 12

Compression:

Stored size: 724 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
# Pulled from Ryan Bate's Nifty Generators
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.map(&:to_s)) }
  end
  
  def javascript(*args)
    args = args.map { |arg| arg == :defaults ? arg : arg.to_s }
    content_for(:head) { javascript_include_tag(*args) }
  end
end

Version data entries

12 entries across 12 versions & 1 rubygems

Version Path
i_reach-3.2.25.1 app/helpers/layout_helper.rb
i_reach-3.2.22.0 app/helpers/layout_helper.rb
i_reach-3.2.7 app/helpers/layout_helper.rb
i_reach-3.2.5 app/helpers/layout_helper.rb
i_reach-3.2.4 app/helpers/layout_helper.rb
i_reach-3.2.3 app/helpers/layout_helper.rb
i_reach-3.2.2 app/helpers/layout_helper.rb
i_reach-3.0.1 app/helpers/layout_helper.rb
i_reach-3.0.0 app/helpers/layout_helper.rb
i_reach-0.1.2 app/helpers/layout_helper.rb
i_reach-0.1.1 app/helpers/layout_helper.rb
i_reach-0.1.0 app/helpers/layout_helper.rb