class AdminIt::ShowContext
Constants
- CONFIRMS
Attributes
confirm[R]
Public Class Methods
entity_path?()
click to toggle source
# File lib/admin_it/context/show_context.rb, line 24 def self.entity_path? true end
read(entity)
click to toggle source
# File lib/admin_it/context/show_context.rb, line 28 def self.read(entity) @read.call(entity) unless @read.nil? end
Protected Class Methods
default_icon()
click to toggle source
# File lib/admin_it/context/show_context.rb, line 15 def default_icon 'info-circle' end
Public Instance Methods
confirm=(value)
click to toggle source
# File lib/admin_it/context/show_context.rb, line 38 def confirm=(value) value = value.ensure_symbol(downcase: true, values: CONFIRMS) || return @confirm = value end
confirm?()
click to toggle source
# File lib/admin_it/context/show_context.rb, line 43 def confirm? !@confirm.nil? end
destroy_entity()
click to toggle source
# File lib/admin_it/context/show_context.rb, line 47 def destroy_entity if entity_destroyer.nil? if controller.respond_to?("#{resource.name}_destroy") controller.send("#{resource.name}_destroy") elsif controller.respond_to?(:destroy_entity) controller.destroy_entity(entity_class) else do_destroy_entity end else entity_destroyer.call(controller) end end
Protected Instance Methods
do_destroy_entity()
click to toggle source
# File lib/admin_it/context/show_context.rb, line 63 def do_destroy_entity; end