Sha256: 56b5eba2d7e1f1046804ec42772994d4f582638dd0fb8326591552ac548c20ce

Contents?: true

Size: 679 Bytes

Versions: 6

Compression:

Stored size: 679 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) { h(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
  
  def app_name
    Rails.application.class.to_s.split("::").first
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
bootstrapped-2.0.4 lib/generators/bootstrapped/layout/templates/layout_helper.rb
bootstrapped-2.0.3 lib/generators/bootstrapped/layout/templates/layout_helper.rb
bootstrapped-1.0.1 lib/generators/bootstrapped/layout/templates/layout_helper.rb
bootstrapped-1.0.0 lib/generators/bootstrapped/layout/templates/layout_helper.rb
bootstrapped-0.9.0 lib/generators/bootstrapped/layout/templates/layout_helper.rb
bootstrapped-0.0.6 lib/generators/bootstrapped/layout/templates/layout_helper.rb