class User < ActiveRecord::Base
accepts_nested_attributes_for :emails, :allow_destroy => true,
:reject_if => proc { |attributes| attributes[‘address’].blank? }
end
class Email < ActiveRecord::Base
belongs_to :user
validates_presence_of :address
validates_email_format_of :address
validates_uniqueness_of :address, :scope=>‘user_id’
end
when i am saving multiple same emails at one time it is saving , but it
should not
Please suggest what i am missing
Thanks
Rajeev sharma