Class: AdminIt::ShowContext
Constant Summary
collapse
- CONFIRMS =
%i(destroy update)
Instance Attribute Summary collapse
Class Method Summary
collapse
Instance Method Summary
collapse
Instance Attribute Details
Returns the value of attribute confirm.
30
31
32
|
# File 'lib/admin_it/context/show_context.rb', line 30
def confirm
@confirm
end
|
Class Method Details
.entity_path? ⇒ Boolean
20
21
22
|
# File 'lib/admin_it/context/show_context.rb', line 20
def self.entity_path?
true
end
|
.read(entity) ⇒ Object
24
25
26
27
28
|
# File 'lib/admin_it/context/show_context.rb', line 24
def self.read(entity)
unless @read.nil?
@read.call(entity)
end
end
|
.render(entity, instance = nil, &block) ⇒ Object
Originally defined in module
Renderable
Instance Method Details
#confirm? ⇒ Boolean
42
43
44
|
# File 'lib/admin_it/context/show_context.rb', line 42
def confirm?
!@confirm.nil?
end
|
#destroy_entity ⇒ Object
46
47
48
49
50
51
52
53
54
55
56
57
58
|
# File 'lib/admin_it/context/show_context.rb', line 46
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
|