Class: Compony::Components::Destroy

Inherits:
Compony::Component show all
Includes:
Compony::ComponentMixins::Resourceful
Defined in:
lib/compony/components/destroy.rb

Overview

This component is used for the Rails destroy paradigm. Asks for confirm when queried using GET.

Instance Attribute Summary

Attributes included from Compony::ComponentMixins::Resourceful

#data, #global_after_assign_attributes_block, #global_after_load_data_block, #global_assign_attributes_block, #global_load_data_block, #global_store_data_block

Attributes inherited from Compony::Component

#comp_opts, #content_blocks, #parent_comp

Instance Method Summary collapse

Methods included from Compony::ComponentMixins::Resourceful

#after_assign_attributes, #after_load_data, #assign_attributes, #data_class, #initialize, #load_data, #resourceful?, #resourceful_sub_comp, #store_data

Methods inherited from Compony::Component

#before_render, comp_name, #content, #exposed_intents, family_name, #id, #id_path, #id_path_hash, #initialize, #inspect, #param_name, #path, #remove_content, #remove_content!, #render, #resourceful?, #root_comp, #root_comp?, setup, #sub_comp

Instance Method Details

#on_destroyed(&block) ⇒ Object

DSL method Sets a block that is evaluated with backfire in the successful case after storing, but before responding.



83
84
85
# File 'lib/compony/components/destroy.rb', line 83

def on_destroyed(&block)
  @on_destroyed_block = block
end

#on_destroyed_redirect_path(&block) ⇒ Object

DSL method



93
94
95
# File 'lib/compony/components/destroy.rb', line 93

def on_destroyed_redirect_path(&block)
  @on_destroyed_redirect_path_block = block
end

#on_destroyed_respond(&block) ⇒ Object

DSL method



88
89
90
# File 'lib/compony/components/destroy.rb', line 88

def on_destroyed_respond(&block)
  @on_destroyed_respond_block = block
end