Module: Forme::Template::Helper

Included in:
ERB::Helper, Roda::RodaPlugins::FormeRouteCsrf::InstanceMethods
Defined in:
lib/forme/template.rb

Overview

This is the module used to add the Forme integration to ERB.

Instance Method Summary collapse

Instance Method Details

#form(obj = nil, attr = {}, opts = {}, &block) ⇒ Object

Create a Form object tied to the current output buffer, using the standard ERB hidden tags.



59
60
61
62
63
64
65
66
67
68
69
70
# File 'lib/forme/template.rb', line 59

def form(obj=nil, attr={}, opts={}, &block)
  if obj.is_a?(Hash)
    attribs = obj
    options = attr = attr.dup
  else
    attribs = attr
    options = opts = opts.dup
  end

  _forme_form_options(obj, attribs, options)
  _forme_form(obj, attr, opts, &block)
end