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
- NAVIGATION_ICONS =
Boostrap icons to be used for specific resources.
{ '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
-
#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.
30 31 32 33 34 35 |
# File 'app/helpers/navigable_helper.rb', line 30 def Recourse.resources.select { |k, v| v[:routes].include? :index }.map do |resource, | caption = resource.to_s.singularize.humanize.pluralize [caption, url_for(resource), (caption)] end end |