Module: Cms::NavMenuHelper

Extended by:
ActiveSupport::Concern
Defined in:
app/helpers/cms/nav_menu_helper.rb

Instance Method Summary collapse

Instance Method Details

#new_button_pathObject

In most cases, the ‘New’ button should go to create a new page.



10
11
12
# File 'app/helpers/cms/nav_menu_helper.rb', line 10

def new_button_path
  cms.new_section_page_path(target_section)
end

#target_sectionObject

Used to determine which section a New Page should go in, based on the current context.



15
16
17
18
19
20
21
# File 'app/helpers/cms/nav_menu_helper.rb', line 15

def target_section
  if @page && @page.parent
    @page.parent
  else
    Cms::Section.first
  end
end