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
#confirm ⇒ Object
Returns the value of attribute confirm.
32
33
34
|
# File 'lib/admin_it/context/show_context.rb', line 32
def confirm
@confirm
end
|
Class Method Details
.entity_path? ⇒ Boolean
24
25
26
|
# File 'lib/admin_it/context/show_context.rb', line 24
def self.entity_path?
true
end
|
.read(entity) ⇒ Object
28
29
30
|
# File 'lib/admin_it/context/show_context.rb', line 28
def self.read(entity)
@read.call(entity) unless @read.nil?
end
|
.render(entity, instance = nil, &block) ⇒ Object
Originally defined in module
Renderable
.renderable? ⇒ Boolean
Originally defined in module
Renderable
Instance Method Details
#confirm? ⇒ Boolean
43
44
45
|
# File 'lib/admin_it/context/show_context.rb', line 43
def confirm?
!@confirm.nil?
end
|
#destroy_entity ⇒ Object
47
48
49
50
51
52
53
54
55
56
57
58
59
|
# 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
|
#identity ⇒ Object
Originally defined in module
Identifiable