Class: CamaleonCms::NavMenu
- Inherits:
-
TermTaxonomy
- Object
- TermTaxonomy
- CamaleonCms::NavMenu
- Defined in:
- app/models/camaleon_cms/nav_menu.rb
Instance Method Summary collapse
-
#append_menu_item(value) ⇒ Object
add menu item for current menu value: (Hash) is a hash object that contains label, type, link options for type: post | category | post_type | post_tag | external sample: "my label", type: "external", link: "https://camaleon.website", target: '_blank' sample: "my label", type: "post", link: 10 sample: "my label", type: "category", link: 12 return item created.
-
#skip_slug_validation? ⇒ Boolean
skip uniq slug validation.
Instance Method Details
#append_menu_item(value) ⇒ Object
add menu item for current menu value: (Hash) is a hash object that contains label, type, link options for type: post | category | post_type | post_tag | external sample: "my label", type: "external", link: "https://camaleon.website", target: '_blank' sample: "my label", type: "post", link: 10 sample: "my label", type: "category", link: 12 return item created
21 22 23 |
# File 'app/models/camaleon_cms/nav_menu.rb', line 21 def (value) children.create!({ name: value[:label], url: value[:link], kind: value[:type], target: value[:target] }) end |
#skip_slug_validation? ⇒ Boolean
skip uniq slug validation
26 27 28 |
# File 'app/models/camaleon_cms/nav_menu.rb', line 26 def skip_slug_validation? true end |