ok I thought it would return nil thanks for response
On Jun 19, 8:33 pm, Fernando Almeida <[email protected]> wrote: > if the record is not found the find() throws an exception. > > 2012/6/19 John Merlino <[email protected]> > > > > > > > > > > > Hey all, > > > I saw this piece of code: > > > @user = User.find(params[:user_id]) rescue nil > > > why rescue with a nil here? If the user is not found, it will be nil > > anyway. > > > -- > > 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 [email protected]. > > To unsubscribe from this group, send email to > > [email protected]. > > For more options, visit this group at > >http://groups.google.com/group/rubyonrails-talk?hl=en. > > -- > Fernando Almeidawww.fernandoalmeida.net -- 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 [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.

