Class: Formtastic::FormBuilder
- Inherits:
-
ActionView::Helpers::FormBuilder
- Object
- ActionView::Helpers::FormBuilder
- Formtastic::FormBuilder
- Includes:
- Helpers::ButtonsHelper, Helpers::ErrorsHelper, Helpers::InputHelper, Helpers::InputsHelper, HtmlAttributes
- Defined in:
- lib/formtastic/form_builder.rb
Direct Known Subclasses
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
A thin wrapper around ‘ActionView::Helpers::FormBuilder#fields_for` helper to set `:builder => Formtastic::FormBuilder` for nesting forms inside the builder.
Methods included from Helpers::ErrorsHelper
#inline_errors_for, #semantic_errors
Methods included from Helpers::Reflection
Methods included from Helpers::FileColumnDetection
Methods included from Helpers::ButtonsHelper
Methods included from Helpers::InputsHelper
Methods included from Helpers::InputHelper
Instance Attribute Details
#auto_index ⇒ Object (readonly)
Returns the value of attribute auto_index.
34 35 36 |
# File 'lib/formtastic/form_builder.rb', line 34 def auto_index @auto_index end |
#template ⇒ Object (readonly)
Returns the value of attribute template.
32 33 34 |
# File 'lib/formtastic/form_builder.rb', line 32 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
A thin wrapper around ‘ActionView::Helpers::FormBuilder#fields_for` helper to set `:builder => Formtastic::FormBuilder` for nesting forms inside the builder. Can be used in the same way, but you’ll also have access to the helpers in ‘Formtastic::FormBuilder` (such as Helpers::InputHelper#input, etc) inside the block.
66 67 68 69 70 71 |
# File 'lib/formtastic/form_builder.rb', line 66 def semantic_fields_for(record_or_name_or_array, *args, &block) opts = args. opts[:builder] ||= self.class args.push(opts) fields_for(record_or_name_or_array, *args, &block) end |