Currently experimenting with Ember.js and loving it so far. The biggest pain point I have run across is dealing with complex forms that control multiple models. In Rails this is a fairly straightforwad process.
# Models
class Person < ActiveRecord::Base
attr_accessible :addresses_attributes
has_many :addresses
accepts_nested_attributes_for :addresses
end
class Address < ActiveRecord::Base
belongs_to :person
end
# View
<%= form_for @person do |f| %>
<%= f.text_field :name %>
<%= f.fields_for :addresses do |af| %>
<%= af.text_field :street %>
<% end%>
<% end %>
With Ember, I already know how to nest routes and represent multiple objects with one route. What I cannot figure out is how to actually manipulate those models using one form, while still respecting any relevant validation logic, binding and dirty-checking. Any pointers?
EDIT: This seems to be a real issue with Ember Data, so it looks like I will have to figure out how to do this with plain Ember objects.