Hi Robert, Thanks for reply.
So does it mean JSON cannot represent a single nil object ? serious !? Ajax calls the action and it can treat the error as nil object as you mentioned but isn't it ugly ??? thanks in advance. wolfgang On Mon, Jan 12, 2009 at 8:39 AM, Robert Walker <[email protected]> wrote: > > wolfgang wrote: >> How can I avoid this situation ??? > I don't know specifically why Rails generates that particular error, but > that doesn't really matter, because render :json => nil is not valid. > You need to check for nil and respond with a properly constructed error > response, including the proper HTTP error status. I think most people > response with a 404 - Page not found in this case, but I'm not > completely sure of that. > -- > Posted via http://www.ruby-forum.com/. > > > > --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---

