class Spree::BackendConfiguration::MenuItem

An item which should be drawn in the admin menu

Attributes

condition[R]
icon[R]
label[R]
match_path[R]
partial[R]
position[RW]
sections[R]
url[R]

Public Class Methods

new( sections, icon, condition: nil, label: nil, partial: nil, url: nil, position: nil, match_path: nil ) click to toggle source

@param sections [Array<Symbol>] The sections which are contained within

this admin menu section.

@param icon [String] The icon to draw for this menu item @param condition [Proc] A proc which returns true if this menu item

should be drawn. If nil, it will be replaced with a proc which always
returns true.

@param label [Symbol] The translation key for a label to use for this

menu item.

@param partial [String] A partial to draw within this menu item for use

in declaring a submenu

@param url [String] A url where this link should send the user to @param position [Integer] The position in which the menu item should render

nil will cause the item to render last

@param match_path [String, Regexp] (nil) If the {url} to determine the active tab is ambigous

you can pass a String or Regexp to identify this menu item
# File lib/spree/backend_configuration.rb, line 47
def initialize(
  sections,
  icon,
  condition: nil,
  label: nil,
  partial: nil,
  url: nil,
  position: nil,
  match_path: nil
)

  @condition = condition || -> { true }
  @sections = sections
  @icon = icon
  @label = label || sections.first
  @partial = partial
  @url = url
  @position = position
  @match_path = match_path
end