Problem with association when getting a validation error on update

Quick overview:

2 classes-

class Building < ActiveRecord::Base   has_many :styles, :dependent => :destroy   validates_presence_of :address1   accepts_nested_attributes_for :styles, :allow_destroy => true end

class Style < ActiveRecord::Base   belongs_to :building end

The sequence of my problem is as follows:

- Edit building view and retrieve is different styles (so I can manipulate them through accepts_nested_attributes_for) - I delete one of the mandatory fields in building (on testing purpose) - Using javascript I add a new style to the form so it saves on update new attribute and association - Submit update form - Validation detects an error (one mandatory field in building is missing) - Edit view is rendered with validation error And here is my problem: - The style I added before shows now is showing as if it was already saved. And it is not. - I add the missing field to building - Submit Update - I get this error: expected Array (got Hash) for param `styles_attributes'

How can I access the update object after validation fails and hasn't been saved?

Thanks a lot!