Method: Padrino::Helpers::FormHelpers#form_for
- Defined in:
- padrino-helpers/lib/padrino-helpers/form_helpers.rb
#form_for(object, url, options = {}, &block) {|AbstractFormBuilder| ... } ⇒ String
Constructs a form for object using given or default form_builder.
44 45 46 47 48 49 50 |
# File 'padrino-helpers/lib/padrino-helpers/form_helpers.rb', line 44 def form_for(object, url, ={}, &block) instance = builder_instance(object, ) # this can erect instance.multipart flag if the block calls instance.file_field html = capture_html(instance, &block) = { :multipart => instance.multipart }.update(.reject{ |key,_| [:namespace, :as].include?(key) }) form_tag(url, ) { html } end |