Skip to content

Rails 2.1 breaks prototype’s responseJSON

by Topper on September 9th, 2008

It appears that a render of json:

RUBY:
  1. render :json => {:blah => "hi"}.to_json

Is responding with a mime type of text/json instead of the previous application/json

The latest version of prototype (and previous versions) specifically looks for application/json in order to fill the responseJSON property of the response object.

From → Social Web

One Comment
  1. Registering a mimetype will fix it:
    Mime::Type.register “application/json”, :json

Leave a Reply

Note: XHTML is allowed. Your email address will never be published.

Subscribe to this comment feed via RSS