Class: Compony::Components::Edit

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

Overview

This component is used for the Rails edit and update paradigm. Performs update when the form is submitted.

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 WithForm

#form_comp, #form_comp_class, #initialize, #submit_path, #submit_verb

Methods inherited from Compony::Component

#action, #before_render, #comp_cst, #comp_name, #content, #family_cst, #family_name, #id, #initialize, #inspect, #param_name, #path, #path_hash, #remove_content, #remove_content!, #render, #render_actions, #resourceful?, #root_comp, #root_comp?, setup, #skip_action, #sub_comp

Instance Method Details

#on_update_failed(&block) ⇒ Object

DSL method



104
105
106
# File 'lib/compony/components/edit.rb', line 104

def on_update_failed(&block)
  @on_update_failed_block = block
end

#on_updated(&block) ⇒ Object

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



89
90
91
# File 'lib/compony/components/edit.rb', line 89

def on_updated(&block)
  @on_updated_block = block
end

#on_updated_redirect_path(&block) ⇒ Object

DSL method



99
100
101
# File 'lib/compony/components/edit.rb', line 99

def on_updated_redirect_path(&block)
  @on_updated_redirect_path_block = block
end

#on_updated_respond(&block) ⇒ Object

DSL method



94
95
96
# File 'lib/compony/components/edit.rb', line 94

def on_updated_respond(&block)
  @on_updated_respond_block = block
end