Sha256: 5865251d245768bdd2769dc15d13a910cb6569c6fe1ea941b939d8c2d6626910

Contents?: true

Size: 549 Bytes

Versions: 11

Compression:

Stored size: 549 Bytes

Contents

# encoding: utf-8
module TestServer
  class BreadcrumbBuilder < BreadcrumbsOnRails::Breadcrumbs::Builder
    private

    attr_reader :elements, :options, :context

    public

    def render
      elements.collect { |e| render_element(e) }.join
    end

    def render_element(element)
      if element.path == nil
        content = compute_name(element)
      else
        content = context.link_to_unless_current(compute_name(element), compute_path(element), element.options)
      end

      context.content_tag('li', content)
    end
  end
end

Version data entries

11 entries across 11 versions & 1 rubygems

Version Path
test_server-0.5.2 config/initializers/breadbrumb_builder.rb
test_server-0.5.1 config/initializers/breadbrumb_builder.rb
test_server-0.5.0 config/initializers/breadbrumb_builder.rb
test_server-0.4.1 config/initializers/breadbrumb_builder.rb
test_server-0.4.0 config/initializers/breadbrumb_builder.rb
test_server-0.3.7 config/initializers/breadbrumb_builder.rb
test_server-0.3.6 config/initializers/breadbrumb_builder.rb
test_server-0.3.5 config/initializers/breadbrumb_builder.rb
test_server-0.3.4 config/initializers/breadbrumb_builder.rb
test_server-0.3.2 config/initializers/breadbrumb_builder.rb
test_server-0.3.1 config/initializers/breadbrumb_builder.rb