Sha256: d411b1560aa0524201e12c75592a04b7597f5527a1e5af43860899763b5d3a76
Contents?: true
Size: 920 Bytes
Versions: 29
Compression:
Stored size: 920 Bytes
Contents
module ExpressAdmin module Components module Navigation class CommandButtonList < ExpressTemplates::Components::Configurable include ExpressTemplates::Components::Capabilities::Resourceful tag :ul has_argument :id, "The name of the resource for this command. Eg. 'person' for like_person_path()", as: :resource_name, type: :symbol # has_option :exclude, "Exclude some buttons" # has_option :only, "only some buttons" contains -> { commands.each do |command| li { command_button(command, disabled: !available?(command)) } end } def resource_name config[:resource_name] end def available?(command) resource.available_commands.include?(command) end def commands resource.commands end end end end end
Version data entries
29 entries across 29 versions & 1 rubygems