Sha256: 887162a76660d748bf76f917af3f48374a6da79d945aabfcfb2ad5be88347ddc

Contents?: true

Size: 1.25 KB

Versions: 4

Compression:

Stored size: 1.25 KB

Contents

module RulesEngineView
  module Navigate
    
    def re_breadcrumbs *links
      return if links.empty?
      result = ''.html_safe
      result << '<div class="re-breadcrumbs">'.html_safe
      links[0 ... -1].each do |link|
        result << link
        result << "<span class='re-breadcrumbs-seperator'>></span>".html_safe
      end
      result << "<em>".html_safe
      result << links[-1]
      result << "</em>".html_safe
      # result << "<span class='re-breadcrumbs-seperator'>></span>" if links[-1] == links[0]
      result << '</div>'.html_safe
      result
    end
    
    def re_breadcrumbs_right *links
      return if links.empty?
      result = ''.html_safe
      result << '<div class="re-breadcrumbs">'.html_safe
      links[0 ... -2].each do |link|
        result << link
        result << "<span class='re-breadcrumbs-seperator'>></span>".html_safe
      end
      result << "<em>".html_safe
      result << links[-2]
      result << "</em>".html_safe
      # result << "<span class='re-breadcrumbs-seperator'>></span>" if links[-2] == links[0]
        
      result << "<div class='re-breadcrumb-right'>".html_safe
      result << links[-1]
      result << "</div>".html_safe
      result << '</div>'.html_safe
      result            
    end
  end  
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
rules_engine-0.3.3 lib/rules_engine_view/navigate.rb
rules_engine-0.3.2 lib/rules_engine_view/navigate.rb
rules_engine-0.3.1 lib/rules_engine_view/navigate.rb
rules_engine-0.3.0 lib/rules_engine_view/navigate.rb