Sha256: 8a6d36836be665ffb2281dd92f166070d4b8f5fb7d7fd12ac56ff4ce9afd01d0

Contents?: true

Size: 890 Bytes

Versions: 2

Compression:

Stored size: 890 Bytes

Contents

# The SimpleBuilder is the default breadcrumb builder.
# It provides basic functionalities to render a breadcrumb navigation.
#
# The SimpleBuilder accepts a limited set of options.
# If you need more flexibility, create a custom Builder and
# pass the option :builder => BuilderClass to the <tt>render_breadcrumbs</tt> helper method.
#
module BreadcrumbsOnRailsMicrodataBuilder
  module Breadcrumbs
    class SimpleBuilder < Builder

      def render
        @elements.collect do |element|
          render_element(element)
        end.join(@options[:separator] || " &raquo; ")
      end

      def render_element(element)
        content = @context.link_to_unless_current(compute_name(element), compute_path(element), element.options)
        if @options[:tag]
          @context.content_tag(@options[:tag], content)
        else
          content
        end
      end

    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
breadcrumbs_on_rails_microdata_builder-2.2.3 lib/breadcrumbs_on_rails_microdata_builder/breadcrumbs/simple_builder.rb
breadcrumbs_on_rails_microdata_builder-2.2.2 lib/breadcrumbs_on_rails_microdata_builder/breadcrumbs/simple_builder.rb