Hi,
i am trying to save an object with 2 associated objects:
Organisation has_many :users
has_many :addresses
def new
@org = Organisation.new
@user = @org.users.build
@address = @org.addresses.build
end
view:
<%= error_messages_for ‘organisation’, ‘user’, ‘address’ %>
But, this shows me just the error messages for the organisation. and if
any
associated object’s validation fails, it just shows me:
users is invalid
addresses is invalid
I haven’t specified validates_associated, in any of the 3 models.
Am i doing something wrong?
Regards
–
Sahil