is this syntax correct ? nested form validation

kadoudal
Wed, 21 Jul 2010 06:51:39 -0000

I am trying to replicate a piece of code used to perform a nested
form validation

it''s written that :

    if [@user, @profile].all?(&;:valid?)

is equivalent to :

   if @user.valid? & @profile.valid?

but the former line fails :   syntax error, unexpected '';''

what could be the correct syntax ?

thanks fyh

--
You received this message because you are subscribed to the Google Groups
"Ruby on Rails: Core" group.
To post to this group, send email to rubyonrails-core@googlegroups.com.
To unsubscribe from this group, send email to
rubyonrails-core+unsubscribe@googlegroups.com.
For more options, visit this group at