module LayoutHelper
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
Public Instance Methods
javascript(*args)
click to toggle source
# File lib/generators/leolay/templates/app/helpers/layout_helper.rb, line 19 def javascript(*args) content_for(:head) { javascript_include_tag(*args) } end
show_title?()
click to toggle source
# File lib/generators/leolay/templates/app/helpers/layout_helper.rb, line 11 def show_title? @show_title end
style_image_tag(name,args={})
click to toggle source
Search image from style path
# File lib/generators/leolay/templates/app/helpers/layout_helper.rb, line 24 def style_image_tag(name,args={}) image_tag("styles/#{CONFIG[:default_style]}/#{name}",args) end
stylesheet(*args)
click to toggle source
# File lib/generators/leolay/templates/app/helpers/layout_helper.rb, line 15 def stylesheet(*args) content_for(:head) { stylesheet_link_tag(*args) } end
title(page_title, show_title = true)
click to toggle source
# File lib/generators/leolay/templates/app/helpers/layout_helper.rb, line 6 def title(page_title, show_title = true) content_for(:title) { page_title.to_s } @show_title = show_title end