Sha256: 233b3aea1730966cd7387aa787e8a2015ad032ee180998a18defa72192d989ad

Contents?: true

Size: 405 Bytes

Versions: 1

Compression:

Stored size: 405 Bytes

Contents

module ActiveAdminMenu
  module DSL
    def allocate_to_menu(is_page: false)
      if item = active_admin_menu.find_item_by(resource_name: config.resource_name.name)
        item.is_page = is_page
        menu(item.to_options)
      else
        menu(if: -> { false })
      end
    end

    private

    def active_admin_menu
      @_active_admin_menu ||= ::ActiveAdminMenu::Menu.build
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
active_admin_menu-0.1.0 lib/active_admin_menu/dsl.rb