Sha256: 0adce330cb2e552114e6dcc17a84e13effa0523176f1edd468b5de4b1e26ecfd
Contents?: true
Size: 1.17 KB
Versions: 4
Compression:
Stored size: 1.17 KB
Contents
module RulesEngineView module Navigate def re_breadcrumbs *links return if links.empty? result = '' result << '<div class="re-breadcrumbs">' links[0 ... -1].each do |link| result << link result << "<span class='re-breadcrumbs-seperator'>></span>" end result << "<em>" result << "#{links[-1]}" result << "</em>" # result << "<span class='re-breadcrumbs-seperator'>></span>" if links[-1] == links[0] result << '</div>' result end def re_breadcrumbs_right *links return if links.empty? result = '' result << '<div class="re-breadcrumbs">' links[0 ... -2].each do |link| result << link result << "<span class='re-breadcrumbs-seperator'>></span>" end result << "<em>" result << "#{links[-2]}" result << "</em>" # result << "<span class='re-breadcrumbs-seperator'>></span>" if links[-2] == links[0] result << "<div class='re-breadcrumb-right'>#{links[-1]}</div>" result << '</div>' result end end end ActionView::Base.class_eval do include RulesEngineView::Navigate end
Version data entries
4 entries across 4 versions & 1 rubygems