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

Instance Method Details

Returns caption and URL of each link a top-level resource.

Returns:

  • (Array<String, String>)

    caption and URL of each link a top-level resource.



4
5
6
7
8
# File 'app/helpers/navigable_helper.rb', line 4

def navigation_links
  Recourse.resources.select { |k, v| v[:routes].include? :index }.map do |resource, options|
    [resource.to_s.singularize.humanize.pluralize, url_for(resource)]
  end
end