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
It should be:
if [@user, @profile].all?(&:valid?)
Get rid of the semi-colon between & and :.
Additionally, please ask questions like these on the rubyonrails-talk mailing list. This mailing list is reserved for discussion pertaining to the core of Ruby on Rails.