Class: Compony::Components::New
- Inherits:
-
WithForm
- Object
- Compony::Component
- WithForm
- Compony::Components::New
- Includes:
- Compony::ComponentMixins::Resourceful
- Defined in:
- lib/compony/components/new.rb
Overview
This component is used for the Rails new and create 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
Instance Method Summary collapse
-
#on_create_failed_respond(&block) ⇒ Object
DSL method.
-
#on_created(&block) ⇒ Object
DSL method Sets a block that is evaluated with backfire in the successful case after storing, but before responding.
-
#on_created_redirect_path(&block) ⇒ Object
DSL method.
-
#on_created_respond(&block) ⇒ Object
DSL method.
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, #add_content, #before_render, #comp_class_for, #comp_class_for!, #comp_cst, #comp_name, #content, #family_cst, #family_name, #id, #initialize, #inspect, #param_name, #path, #path_hash, #render, #render_actions, #resourceful?, #root_comp, #root_comp?, setup, #skip_action, #sub_comp
Instance Method Details
#on_create_failed_respond(&block) ⇒ Object
DSL method
97 98 99 |
# File 'lib/compony/components/new.rb', line 97 def on_create_failed_respond(&block) @on_create_failed_respond_block = block end |
#on_created(&block) ⇒ Object
DSL method Sets a block that is evaluated with backfire in the successful case after storing, but before responding.
82 83 84 |
# File 'lib/compony/components/new.rb', line 82 def on_created(&block) @on_created_block = block end |
#on_created_redirect_path(&block) ⇒ Object
DSL method
92 93 94 |
# File 'lib/compony/components/new.rb', line 92 def on_created_redirect_path(&block) @on_created_redirect_path_block = block end |
#on_created_respond(&block) ⇒ Object
DSL method
87 88 89 |
# File 'lib/compony/components/new.rb', line 87 def on_created_respond(&block) @on_created_respond_block = block end |