rails/rails — pull request #15580 by crismali (2014-06-08 22:17:37+00:00)
Title: Nested error messages from associations

Now when a nested model has an error, it will be nested in the base
model's error messages hash in addition to the nested model's error
messages hash.

For example, if a user has two posts that are invalid (the first one
lacks a title and the other lacks a body), we get:
```ruby
{
:"posts.title" => ["can't be blank"],
:"posts.body" => ["can't be blank"],
:posts => [
{ title: ["can't be blank"] },
{ body: ["can't be blank"] }
]
}
```
Instead of just:
```ruby
{
:"posts.title" => ["can't be blank"],
:"posts.body" => ["can't be blank"]
}
```

This makes it much easier to render errors on a fat client app when dealing with nested models.