Sha256: 208024b56ae6fecb96a24ae8f51aac1cf8e467ce9707dfd1c817423a0165fe5c

Contents?: true

Size: 549 Bytes

Versions: 15

Compression:

Stored size: 549 Bytes

Contents

module Integrity
  module Helpers
    module Breadcrumbs
      def pages
        @pages ||= [["projects", "/"], ["new project", "/new"]]
      end

      def breadcrumbs(*crumbs)
        crumbs[0..-2].map do |crumb|
          if page_data = pages.detect {|c| c.first == crumb }
            %Q(<a href="#{page_data.last}">#{page_data.first}</a>)
          elsif @project && @project.permalink == crumb
            %Q(<a href="#{project_url(@project)}">#{@project.permalink}</a>)
          end
        end + [crumbs.last]
      end

    end
  end
end

Version data entries

15 entries across 15 versions & 6 rubygems

Version Path
brycethornton-integrity-0.1.7.1 lib/integrity/helpers/breadcrumbs.rb
foca-integrity-0.1.6 lib/integrity/helpers/breadcrumbs.rb
foca-integrity-0.1.7 lib/integrity/helpers/breadcrumbs.rb
foca-integrity-0.1.8 lib/integrity/helpers/breadcrumbs.rb
foca-integrity-0.1.9.0 lib/integrity/helpers/breadcrumbs.rb
foca-integrity-0.1.9.1 lib/integrity/helpers/breadcrumbs.rb
myronmarston-integrity-0.1.7.1 lib/integrity/helpers/breadcrumbs.rb
oliyoung-integrity-0.1.9.0 lib/integrity/helpers/breadcrumbs.rb
sr-integrity-0.1.8.1 lib/integrity/helpers/breadcrumbs.rb
sr-integrity-0.1.9.1 lib/integrity/helpers/breadcrumbs.rb
sr-integrity-0.1.9.2 lib/integrity/helpers/breadcrumbs.rb
integrity-0.1.8 lib/integrity/helpers/breadcrumbs.rb
integrity-0.1.9.1 lib/integrity/helpers/breadcrumbs.rb
integrity-0.1.9.0 lib/integrity/helpers/breadcrumbs.rb
integrity-0.1.9 lib/integrity/helpers/breadcrumbs.rb