Class: Panda::CMS::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



32
33
34
35
36
37
38
39
40
# File 'app/models/panda/cms/menu_item.rb', line 32

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