Module: Bootstrap4FormBuilder::Helper
- Defined in:
- lib/bootstrap4_form_builder/helper.rb
Instance Method Summary collapse
- #bootstrap_form_for(object, options = {}, &block) ⇒ Object
- #temporarily_disable_field_error_proc ⇒ Object
Instance Method Details
#bootstrap_form_for(object, options = {}, &block) ⇒ Object
4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 |
# File 'lib/bootstrap4_form_builder/helper.rb', line 4 def bootstrap_form_for(object, = {}, &block) .reverse_merge!({builder: Bootstrap4FormBuilder::FormBuilder::BootstrapBuilder}) [:html] ||= {} [:html][:role] ||= "form" #Done in Builder # if options[:layout] == :inline # options[:html][:class] = [options[:html][:class], "form-inline"].compact.join(" ") # end #Done in Builder #temporarily_disable_field_error_proc do form_for(object, , &block) #end end |
#temporarily_disable_field_error_proc ⇒ Object
22 23 24 25 26 27 28 |
# File 'lib/bootstrap4_form_builder/helper.rb', line 22 def temporarily_disable_field_error_proc original_proc = ActionView::Base.field_error_proc ActionView::Base.field_error_proc = proc { |input, instance| input } yield ensure ActionView::Base.field_error_proc = original_proc end |