Module: Forma::Helpers
- Defined in:
- lib/forma/helpers.rb
Class Method Summary collapse
Instance Method Summary collapse
Class Method Details
.forma_for(model, opts = {}) {|f| ... } ⇒ Object
4 5 6 7 8 9 10 11 12 |
# File 'lib/forma/helpers.rb', line 4 def forma_for(model, opts = {}) opts[:model] = model opts[:edit] = true opts[:auth_token] = form_authenticity_token if defined?(Rails) opts[:method] = 'post' if opts[:method].blank? f = Forma::Form.new(opts) yield f if block_given? f.to_html.to_s end |