Hello,
I have a view on which I accept multiple objects of the same model. I create an array like
@member_list= 5.times{ @member_list<<Member.new }
user can enter the data for upto 5 members on the same screen. Now how do I check whether a particular array entry is empty or not. For example, if user entered data for only 3 members then only 3 objects should be saved. How do I check for empty object? Also, is there any way to access validation error for individual object in the array i.e. if user missed first name in first and date of birth is not valid in 3rd then how can I get the errors separately for each object validation?
Thanks.