Module: NavigableHelper

Defined in:
app/helpers/navigable_helper.rb

Overview

A collection of helper to display root resources as a Bootstrap-styled navbar.

Constant Summary collapse

{
  'Answers' => 'question-circle',
  'Apps' => 'window',
  'Assessments' => 'clipboard-check',
  'Bookings' => 'calendar-check',
  'Campaigns' => 'megaphone',
  'Conversations' => 'chat-dots',
  'Counties' => 'map',
  'Episodes' => 'collection-play',
  'Evaluations' => 'speedometer2',
  'Franchises' => 'shop',
  'Logout' => 'box-arrow-right',
  'Offer questions' => 'gift',
  'Optimizations' => 'sliders',
  'Prompts' => 'terminal',
  'Providers' => 'people-fill',
  'Satisfaction questions' => 'emoji-smile',
  'Searches' => 'search',
  'Settings' => 'gear',
  'Specialties' => 'award',
  'Specialty matches' => 'award',
  'Verticals' => 'bar-chart',
  'ZIPs' => 'geo-alt-fill',
}

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.



30
31
32
33
34
35
# File 'app/helpers/navigable_helper.rb', line 30

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