Sha256: 30d96b94e1b038496493638e68c0a138994e4ca9c3253d90fb5227465b4dcedd

Contents?: true

Size: 560 Bytes

Versions: 7

Compression:

Stored size: 560 Bytes

Contents

require 'tao_on_rails/components/base'

module TaoOnRails
  module Components
    class PageComponent < Base

      def initialize view, options = {}
        super

        @page_id = view.page_id

        if @options[:class].present?
          @options[:class] += " tao-page #{@page_id}-page"
        else
          @options[:class] = "tao-page #{@page_id}-page"
        end
      end

      def render &block
        view.content_tag "#{view.page_id}-page", options, &block
      end

      def self.component_name
        :page
      end

    end
  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
tao_on_rails-0.8.2 lib/tao_on_rails/components/page_component.rb
tao_on_rails-0.8.1 lib/tao_on_rails/components/page_component.rb
tao_on_rails-0.8.0 lib/tao_on_rails/components/page_component.rb
tao_on_rails-0.7.3 lib/tao_on_rails/components/page_component.rb
tao_on_rails-0.7.2 lib/tao_on_rails/components/page_component.rb
tao_on_rails-0.7.1 lib/tao_on_rails/components/page_component.rb
tao_on_rails-0.7.0 lib/tao_on_rails/components/page_component.rb