Sha256: a1159dfb08d173f327f5220206b4af4495e670eaa6ee27f2608ef2a6154a0dcd

Contents?: true

Size: 528 Bytes

Versions: 29

Compression:

Stored size: 528 Bytes

Contents

module ConteRailsTemplate
  class BreadcrumbsRenderer < SimpleNavigation::Renderer::Base
    def render(item_container)
      a_tags(item_container).join.html_safe
    end

    protected

    def a_tags(item_container)
      item_container.items.inject([]) do |list, item|
        if item.selected?
          list << content_tag(:li, tag_for(item)) if item.selected?
          if include_sub_navigation?(item)
            list.concat a_tags(item.sub_navigation)
          end
        end
        list
      end
    end
  end
end

Version data entries

29 entries across 29 versions & 1 rubygems

Version Path
conte_rails_template-0.1.11 lib/breadcrumbs_renderer.rb
conte_rails_template-0.1.9 lib/breadcrumbs_renderer.rb
conte_rails_template-0.1.8 lib/breadcrumbs_renderer.rb
conte_rails_template-0.1.7 lib/breadcrumbs_renderer.rb
conte_rails_template-0.1.6 lib/breadcrumbs_renderer.rb
conte_rails_template-0.1.5 lib/breadcrumbs_renderer.rb
conte_rails_template-0.1.4 lib/breadcrumbs_renderer.rb
conte_rails_template-0.1.3 lib/breadcrumbs_renderer.rb
conte_rails_template-0.1.2 lib/breadcrumbs_renderer.rb
conte_rails_template-0.1.1 lib/breadcrumbs_renderer.rb
conte_rails_template-0.1.0 lib/breadcrumbs_renderer.rb
conte_rails_template-0.0.37 lib/breadcrumbs_renderer.rb
conte_rails_template-0.0.36 lib/breadcrumbs_renderer.rb
conte_rails_template-0.0.35 lib/breadcrumbs_renderer.rb
conte_rails_template-0.0.34 lib/breadcrumbs_renderer.rb
conte_rails_template-0.0.33 lib/breadcrumbs_renderer.rb
conte_rails_template-0.0.32 lib/breadcrumbs_renderer.rb
conte_rails_template-0.0.31 lib/breadcrumbs_renderer.rb
conte_rails_template-0.0.30 lib/breadcrumbs_renderer.rb
conte_rails_template-0.0.29 lib/breadcrumbs_renderer.rb