Sha256: 3c305716a9f3ed02341aae3d3be79354112a72826c44cd75157e58a198c90429

Contents?: true

Size: 532 Bytes

Versions: 11

Compression:

Stored size: 532 Bytes

Contents

module Cms
  module NavMenuHelper
    extend ActiveSupport::Concern

    included do
      helper_method :new_button_path, :target_section
    end

    # In most cases, the 'New' button should go to create a new page.
    def new_button_path
      cms.new_section_page_path(target_section)
    end

    # Used to determine which section a New Page should go in, based on the current context.
    def target_section
      if @page && @page.parent
        @page.parent
      else
        Cms::Section.first
      end
    end
  end
end

Version data entries

11 entries across 11 versions & 2 rubygems

Version Path
browsercms-artirix-4.0.4 app/helpers/cms/nav_menu_helper.rb
browsercms-artirix-4.0.3.3 app/helpers/cms/nav_menu_helper.rb
browsercms-artirix-4.0.3.2 app/helpers/cms/nav_menu_helper.rb
browsercms-artirix-4.0.3.1 app/helpers/cms/nav_menu_helper.rb
browsercms-artirix-4.0.3 app/helpers/cms/nav_menu_helper.rb
browsercms-artirix-4.0.2 app/helpers/cms/nav_menu_helper.rb
browsercms-artirix-4.0.1.1 app/helpers/cms/nav_menu_helper.rb
browsercms-artirix-4.0.0.rc1.art4 app/helpers/cms/nav_menu_helper.rb
browsercms-4.0.0.rc1 app/helpers/cms/nav_menu_helper.rb
browsercms-4.0.0.beta app/helpers/cms/nav_menu_helper.rb
browsercms-4.0.0.alpha app/helpers/cms/nav_menu_helper.rb