Module: NavigableHelper
- Defined in:
- app/helpers/navigable_helper.rb
Overview
A collection of helper to display root resources as a Bootstrap-styled navbar.
Instance Method Summary collapse
-
#navigation_links ⇒ Array<String, String>
Caption and URL of each link a top-level resource.
Instance Method Details
#navigation_links ⇒ Array<String, String>
Returns caption and URL of each link a top-level resource.
4 5 6 7 8 |
# File 'app/helpers/navigable_helper.rb', line 4 def Recourse.resources.select { |k, v| v[:routes].include? :index }.map do |resource, | [resource.to_s.singularize.humanize.pluralize, url_for(resource)] end end |