Sha256: 1c1630fa9d5e785628c3a90ce3a2d426c5a4ddb520a69434a1efc1686242b28f

Contents?: true

Size: 745 Bytes

Versions: 68

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

68 entries across 68 versions & 1 rubygems

Version Path
noodall-ui-0.5.15 app/helpers/noodall/layout_helper.rb
noodall-ui-0.5.14 app/helpers/noodall/layout_helper.rb
noodall-ui-0.5.13 app/helpers/noodall/layout_helper.rb
noodall-ui-0.5.12 app/helpers/noodall/layout_helper.rb
noodall-ui-0.5.11 app/helpers/noodall/layout_helper.rb
noodall-ui-0.4.11 app/helpers/noodall/layout_helper.rb
noodall-ui-0.4.10 app/helpers/noodall/layout_helper.rb
noodall-ui-0.5.10 app/helpers/noodall/layout_helper.rb
noodall-ui-0.5.9 app/helpers/noodall/layout_helper.rb
noodall-ui-0.4.9 app/helpers/noodall/layout_helper.rb
noodall-ui-0.5.8 app/helpers/noodall/layout_helper.rb
noodall-ui-0.4.8 app/helpers/noodall/layout_helper.rb
noodall-ui-0.4.7 app/helpers/noodall/layout_helper.rb
noodall-ui-0.5.7 app/helpers/noodall/layout_helper.rb
noodall-ui-0.5.6 app/helpers/noodall/layout_helper.rb
noodall-ui-0.5.5 app/helpers/noodall/layout_helper.rb
noodall-ui-0.5.4 app/helpers/noodall/layout_helper.rb
noodall-ui-0.5.3 app/helpers/noodall/layout_helper.rb
noodall-ui-0.5.2 app/helpers/noodall/layout_helper.rb
noodall-ui-0.5.1 app/helpers/noodall/layout_helper.rb