Class: Formtastic::FormBuilder
- Inherits:
-
ActionView::Helpers::FormBuilder
- Object
- ActionView::Helpers::FormBuilder
- Formtastic::FormBuilder
- Defined in:
- lib/formtastic/form_builder.rb
Constant Summary
Constants included from Helpers::ErrorsHelper
Helpers::ErrorsHelper::INLINE_ERROR_TYPES
Constants included from Helpers::InputsHelper
Helpers::InputsHelper::SKIPPED_COLUMNS
Instance Attribute Summary collapse
-
#auto_index ⇒ Object
readonly
Returns the value of attribute auto_index.
-
#template ⇒ Object
readonly
Returns the value of attribute template.
Class Method Summary collapse
Instance Method Summary collapse
-
#semantic_fields_for(record_or_name_or_array, *args, &block) ⇒ Object
This is a wrapper around Rails'
ActionView::Helpers::FormBuilder#fields_for
, originally provided to ensure that the:builder
fromsemantic_form_for
was passed down into the nestedfields_for
.
Instance Attribute Details
#auto_index ⇒ Object (readonly)
Returns the value of attribute auto_index.
36 37 38 |
# File 'lib/formtastic/form_builder.rb', line 36 def auto_index @auto_index end |
#template ⇒ Object (readonly)
Returns the value of attribute template.
34 35 36 |
# File 'lib/formtastic/form_builder.rb', line 34 def template @template end |
Class Method Details
.configure(name, value = nil) ⇒ Object
4 5 6 7 |
# File 'lib/formtastic/form_builder.rb', line 4 def self.configure(name, value = nil) class_attribute(name) self.send(:"#{name}=", value) end |
Instance Method Details
#semantic_fields_for(record_or_name_or_array, *args, &block) ⇒ Object
is there a way to test the params structure of the Rails helper we wrap to ensure forward compatibility?
This is a wrapper around Rails' ActionView::Helpers::FormBuilder#fields_for
, originally
provided to ensure that the :builder
from semantic_form_for
was passed down into
the nested fields_for
. Rails 3 no longer requires us to do this, so this method is
provided purely for backwards compatibility and DSL consistency.
When constructing a fields_for
form fragment outside of semantic_form_for
, please use
Formtastic::Helpers::FormHelper#semantic_fields_for
.
73 74 75 76 77 78 79 80 |
# File 'lib/formtastic/form_builder.rb', line 73 def semantic_fields_for(record_or_name_or_array, *args, &block) # Add a :parent_builder to the args so that nested translations can be possible in Rails 3 = args. [:parent_builder] ||= self # Wrap the Rails helper fields_for(record_or_name_or_array, *(args << ), &block) end |