emberjs/ember.js — pull request #374 by dgeb (2012-01-10 23:29:46+00:00)
Title: Introduce Ember.Form

I'd like to propose `Ember.Form` as a simple view class for `form` tags. This view captures the `submit` event and triggers an action (`submitForm` by default) either on itself or a specific `target`. By default, events won't be propagated, although this can be overridden.

I've created a Rails-backed CRUD application to demonstrate the usage of `Ember.Form` (as well as some simple classes for managing RESTful resources):

https://github.com/dgeb/ember_rest_example

This example app shows an `Ember.Form` based view that includes `Ember.TextField` inputs which keep the backing object's properties in sync with the inputs. The backing object is then saved when the form is submitted.

`Ember.Form` could also be extended to include serialization methods. This would allow forms to include non-bound inputs and still apply those values to a backing object in `submitForm()`. I've excluded a form serialization method to keep this pull request as simple as possible for now.