Sha256: f7c177cf921b7ccc6057134db39c699bcedeb3da34a52eea1cde3bb366741f8f
Contents?: true
Size: 1.08 KB
Versions: 24
Compression:
Stored size: 1.08 KB
Contents
class Breadcrumbs module Render class MyAdmin < Base # :nodoc: all def render options = { :class => "breadcrumbs" }.merge(default_options) tag(:div, options) do html_div = tag(:ul) do html = "" items = breadcrumbs.items size = items.size items.each_with_index do |item, i| html << render_item(item, i, size) end html end html_div << tag(:div, :class => "close-bread") do tag(:a, :href => "#") do tag(:i, :class => "icon-remove") end end html_div end end def render_item(item, i, size) css = [] css << "first" if i == 0 css << "last" if i == size - 1 css << "item-#{i}" text, url, options = *item text = wrap_item(url, CGI.escapeHTML(text), options) text << tag(:i, {:class => "icon-angle-right"}) unless i == size - 1 tag(:li, text, :class => css.join(" ")) end end end end
Version data entries
24 entries across 24 versions & 1 rubygems