module Forme::ERB::Helper

  1. lib/forme/erb.rb

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


Public Instance

  1. form

Public Instance methods

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

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

[show source]
# File lib/forme/erb.rb, line 28
def form(obj=nil, attr={}, opts={}, &block)
  h = {:hidden_tags=>Forme::ERB::HIDDEN_TAGS, :env=>env}
  h[:output] = @_out_buf if block
  (obj.is_a?(Hash) ? attr = attr.merge(h) : opts = opts.merge(h))
  Form.form(obj, attr, opts, &block)