JSON responses for 404 and 500 errors in rails

This post is moved to my new blog. Read this post there

Advertisements

10 comments

  1. This is not working for me. I still get the same old HTML response. I set a debugger in the show_exceptions.rb and it’s not even getting there. What else do I need to do? Where do I place the ErrorsController? I placed it in a directory in app/controllers.

      1. this is the way i’m using right now in rails4 and seems to works smoothly:

        anyway, it was strange for me to se you suggest ExceptionsController(.rb?) file to implement ErrorsController, but i’m not sure this was the problem, because i tried to rename che class name with no luck …

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s