Module: Forme::Rails::ERB

Defined in:
lib/forme/rails.rb

Instance Method Summary collapse

Instance Method Details

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

Create a Form object tied to the current template, and using the standard Rails hidden tags.



105
106
107
108
109
# File 'lib/forme/rails.rb', line 105

def forme(obj=nil, attr={}, opts={}, &block)
  h = {:template=>self, :hidden_tags=>Forme::Rails::HIDDEN_TAGS}
  (obj.is_a?(Hash) ? attr = attr.merge(h) : opts = opts.merge(h))
  Form.form(obj, attr, opts, &block)
end