Module: Integrity::Helpers::Breadcrumbs
- Included in:
- Integrity::Helpers
- Defined in:
- lib/integrity/helpers/breadcrumbs.rb
Instance Method Summary collapse
Instance Method Details
#breadcrumbs(*crumbs) ⇒ Object
8 9 10 11 12 13 14 15 16 |
# File 'lib/integrity/helpers/breadcrumbs.rb', line 8 def (*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_path(@project)}">#{@project.permalink}</a>) end end + [crumbs.last] end |
#pages ⇒ Object
4 5 6 |
# File 'lib/integrity/helpers/breadcrumbs.rb', line 4 def pages @pages ||= [["projects", root_path("/")], ["new project", root_path("/new")]] end |