Module: Motr::Forms::Helpers
- Defined in:
- lib/motr/forms/helpers.rb
Overview
# Custom form helpers and modifications
Instance Method Summary collapse
-
#motr_form(record_name_or_array, *args, &proc) ⇒ Object
Cusomizes the default form_for helper to add additional functionality All params are the same as Rails’ form_for.
Instance Method Details
#motr_form(record_name_or_array, *args, &proc) ⇒ Object
Cusomizes the default form_for helper to add additional functionality All params are the same as Rails’ form_for
18 19 20 21 22 23 24 25 26 27 28 29 30 31 |
# File 'lib/motr/forms/helpers.rb', line 18 def motr_form(record_name_or_array, *args, &proc) raise ArgumentError, "Missing block" unless block_given? = args. .reverse_merge!(:builder => Motr::Forms.default_builder) [:html] ||= {} [:html].merge!('data-validatable' => true) if .delete(:validate) Motr::Forms.with_custom_error_proc do form_for(record_name_or_array, *(args << ), &proc) end end |