Hi, m using rails 3.0.3 and i m getting problem with reject_if .I just want
to check the condition that if all fields of educations table are blank then
reject otherwise their values should be stored in database.
but actually this saves blank also in database.

class Profile < ActiveRecord::Base

 has_many :educations, :dependent => :destroy
 accepts_nested_attributes_for :educations, :reject_if => proc { |a|
a.blank? }, :allow_destroy => true

end


i have tried this also :
 accepts_nested_attributes_for :educationss, :reject_if => lambda { |a|
a.blank? }, :allow_destroy => true

and also :
accepts_nested_attributes_for :educationss, :reject_if => lambda { |a|
a.all_blank? }, :allow_destroy => true

Can anyone give me an idea of what might be going wrong here?

Thanks
kirti

-- 
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Talk" group.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To unsubscribe from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.

Reply via email to