Class: Bp3::Formtastic::VizFormBuilderWithCreate
- Inherits:
-
VizFormBuilder
- Object
- Formtastic::FormBuilder
- VizFormBuilder
- Bp3::Formtastic::VizFormBuilderWithCreate
- Defined in:
- lib/bp3/formtastic/viz_form_builder_with_create.rb
Instance Attribute Summary
Attributes inherited from VizFormBuilder
Instance Method Summary collapse
- #create_input_control_record(element_name, element_ident) ⇒ Object private
- #viz(element_name, element_ident) ⇒ Object
Methods inherited from VizFormBuilder
#initialize, #input, #input_control_class, #load_vizfacts, #vizfact_attrs
Constructor Details
This class inherits a constructor from Bp3::Formtastic::VizFormBuilder
Instance Method Details
#create_input_control_record(element_name, element_ident) ⇒ Object (private)
17 18 19 20 |
# File 'lib/bp3/formtastic/viz_form_builder_with_create.rb', line 17 def create_input_control_record(element_name, element_ident) attrs = vizfact_attrs(element_name, element_ident) Vizfact::Input.unscoped.create!(attrs) end |
#viz(element_name, element_ident) ⇒ Object
6 7 8 9 10 11 12 13 |
# File 'lib/bp3/formtastic/viz_form_builder_with_create.rb', line 6 def viz(element_name, element_ident) return if vizfacts.nil? record = super return record if record create_input_control_record(element_name, element_ident) end |