Sha256: baf2c0bd072ad55420f0edc0474d9b005317ffc35fd5c976f7de01c2bf4df57a

Contents?: true

Size: 745 Bytes

Versions: 28

Compression:

Stored size: 745 Bytes

Contents

module Noodall::LayoutHelper
  def page_class
    @node.nil? ? controller_name : "#{@node.class.name.underscore.parameterize} #{@node.permalink.join(' ')}"
  end

  def page_id
    @node.nil? ? "#{controller_name}-#{action_name}" : @node.permalink.join('-')
  end

  def page_title
    @page_title ||= controller.controller_name.titleize + (controller.action_name == 'index' ? " #{controller.action_name.titleize}" : ' ' )
  end

  attr_reader :page_description, :page_keywords

  # Render flash messages
  def flash_messages
    return if flash.empty?
    flash_divs = flash.collect do |key, value|
      content_tag :div, h( value ), :class => "flash #{key}"
    end

    content_tag :div, flash_divs.join.html_safe, :id => "flash"
  end 
end

Version data entries

28 entries across 28 versions & 1 rubygems

Version Path
noodall-ui-0.1.6 app/helpers/noodall/layout_helper.rb
noodall-ui-0.1.5 app/helpers/noodall/layout_helper.rb
noodall-ui-0.1.4 app/helpers/noodall/layout_helper.rb
noodall-ui-0.1.3 app/helpers/noodall/layout_helper.rb
noodall-ui-0.1.2 app/helpers/noodall/layout_helper.rb
noodall-ui-0.1.1 app/helpers/noodall/layout_helper.rb
noodall-ui-0.1.0 app/helpers/noodall/layout_helper.rb
noodall-ui-0.0.22 app/helpers/noodall/layout_helper.rb
noodall-ui-0.0.21 app/helpers/noodall/layout_helper.rb
noodall-ui-0.0.20 app/helpers/noodall/layout_helper.rb
noodall-ui-0.0.19 app/helpers/noodall/layout_helper.rb
noodall-ui-0.0.18 app/helpers/noodall/layout_helper.rb
noodall-ui-0.0.17 app/helpers/noodall/layout_helper.rb
noodall-ui-0.0.16 app/helpers/noodall/layout_helper.rb
noodall-ui-0.0.15 app/helpers/noodall/layout_helper.rb
noodall-ui-0.0.14 app/helpers/noodall/layout_helper.rb
noodall-ui-0.0.13 app/helpers/noodall/layout_helper.rb
noodall-ui-0.0.12 app/helpers/noodall/layout_helper.rb
noodall-ui-0.0.11 app/helpers/noodall/layout_helper.rb
noodall-ui-0.0.10 app/helpers/noodall/layout_helper.rb