Module: Kitestrings::Menu::Model

Extended by:
ActiveSupport::Concern
Defined in:
lib/kitestrings/menu/model.rb

Defined Under Namespace

Modules: ClassMethods

Instance Method Summary collapse

Instance Method Details

get the display name for this item in the menu structure. Defaults to the :name method, can be specified by setting the menu_name_method class attribute on the class.



13
14
15
16
17
18
19
20
# File 'lib/kitestrings/menu/model.rb', line 13

def menu_display_name
  case
    when respond_to?(menu_name_method)
      self.send(menu_name_method)
    else
      "##{to_key}"
  end
end