Sha256: a6f32231c75ea2a3a898bbfb870824bb02f572c775dd0adbc68de30229101b85

Contents?: true

Size: 307 Bytes

Versions: 12

Compression:

Stored size: 307 Bytes

Contents

class Breadcrumbs < Tags::Tag
  self.tag_name = :ul
  
  def initialize(items)
    super :id => 'breadcrumbs'
    @items = items
  end

  def content
    @items[0, @items.size - 1].map { |item| Tags::Li.new(item.content).render }.join + 
    Tags::Li.new(@items.last.text, :class => 'last').render
  end
end

Version data entries

12 entries across 12 versions & 2 rubygems

Version Path
adva-0.2.4 vendor/gems/tags/lib/breadcrumbs.rb
adva-0.2.3 vendor/gems/tags/lib/breadcrumbs.rb
adva-0.2.2 vendor/gems/tags/lib/breadcrumbs.rb
adva-0.2.1 vendor/gems/tags/lib/breadcrumbs.rb
adva-0.2.0 vendor/gems/tags/lib/breadcrumbs.rb
adva-0.1.4 vendor/gems/tags/lib/breadcrumbs.rb
adva-0.1.3 vendor/gems/tags/lib/breadcrumbs.rb
adva-0.1.2 vendor/gems/tags/lib/breadcrumbs.rb
adva-0.1.1 vendor/gems/tags/lib/breadcrumbs.rb
adva-0.1.0 vendor/gems/tags/lib/breadcrumbs.rb
adva_cms-0.0.1 vendor/gems/tags/lib/breadcrumbs.rb
adva-0.0.1 adva_cms/vendor/gems/tags/lib/breadcrumbs.rb