Class: PandaCms::MenuItem

Inherits:
ApplicationRecord show all
Defined in:
app/models/panda_cms/menu_item.rb

Instance Method Summary collapse

Instance Method Details

Returns the resolved link for the menu item.

If the menu item is associated with a page, it returns the path of the page. If the menu item is associated with an external URL, it returns the external URL.

Returns:

  • (String)

    Resolved link



27
28
29
30
31
32
33
34
35
# File 'app/models/panda_cms/menu_item.rb', line 27

def resolved_link
  if page
    page.path
  elsif external_url
    external_url
  else
    ""
  end
end