for erros you can call method errors on each model object.
the other one, im not really sure. But one thing I could think of is adding
a virtual attribute on the model. and display a check box to the user
wether to save the record or not. then you can iterate to check on that
attribute first.
Ahmy Yulrizka
On Tue, Jul 3, 2012 at 8:52 AM, renu mehta
<lists-fsXkhYbjdPsEEoCn2XhGlw@public.gmane.org> wrote:
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< }
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.
--
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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
To unsubscribe from this group, send email to
rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en-US.