lib/rack/action.rb
def json(data={}, options={})
      response[CONTENT_TYPE] = APPLICATION_JSON
      response.status = options[:status] if options.has_key?(:status)
      response.write self.class.json_serializer.dump(data)
    end
def json(data={}, options={})
      response[CONTENT_TYPE] = APPLICATION_JSON
      response.status = options[:status] if options.has_key?(:status)
      response.write self.class.json_serializer.dump(data)
    end
This is a convenience method that sets the Content-Type headers
 and writes the JSON String to the response.

 @param [Hash] data The data
 @param [Hash] options The options
 @option options [Fixnum] :status The response status code
 @return [String] The JSON