Module: StandardView::MastheadHelper

Defined in:
app/helpers/standard_view/masthead_helper.rb

Instance Method Summary collapse

Instance Method Details

#icon_with_text(icon_type, text) ⇒ Object



23
24
25
# File 'app/helpers/standard_view/masthead_helper.rb', line 23

def icon_with_text(icon_type, text)
  "#{icon_for(icon_type)} #{text}".html_safe
end


19
20
21
# File 'app/helpers/standard_view/masthead_helper.rb', line 19

def masthead_menu_link(destination, icon_type, text, class_name = nil, **options)
  link_to(destination, class: "dropdown-item #{class_name}", **options) { icon_with_text(icon_type, text) }
end


10
11
12
13
# File 'app/helpers/standard_view/masthead_helper.rb', line 10

def masthead_menu_link_for_model(model_class)
  list = Material::List.for(model_class)
  masthead_menu_link list.item_class, list.icon, list.list_title, active_for(controller: list.route_key)
end


15
16
17
# File 'app/helpers/standard_view/masthead_helper.rb', line 15

def masthead_nav_link(destination, text, class_name = nil, **options)
  link_to(destination, class: "nav-item nav-link #{class_name}", **options) { text }
end


5
6
7
8
# File 'app/helpers/standard_view/masthead_helper.rb', line 5

def masthead_nav_link_for_model(model_class)
  list = Material::List.for(model_class)
  masthead_nav_link list.item_class, list.list_title, active_for(controller: list.route_key)
end