I have a strange behavior where an ajax query fails parsing a JSON object returned by my rails 4.1.4 server (jquery-rails is 3.1.1). Yet, the controller is dead stupid:

```
class WelcomeController < ApplicationController    
  def create
    respond_to do |format|
      format.json{ render json: 'ok' }
    end
  end   
end

```

and the Ajax query is all very standard (CoffeeScript):

```
window.Api = {}

(->
  queryFx = (dataType, type, url, data, successFx, failureFx) ->
    $.ajax
      url: url
      type: type
      dataType: dataType
      beforeSend: (xhr) ->
        xhr.setRequestHeader('X-CSRF-Token', $('meta[name="csrf-token"]').attr('content'))
      success: (json) ->
        console.log(json)
      error: (xhr, status, errorThrown) ->
        console.log(status, errorThrown)

  Api.post = (url) ->
    queryFx('json', 'POST', url)

)()

$(document).ready( ->
  $('#request').submit( (event) ->
    event.preventDefault
    window.Api.post($(this).attr('action'))
    return false #Prevent the normal submission
  )
)

```

the query goes fine, only when the reply comes, ajax throws:

```
"parsererror" SyntaxError: JSON.parse: unexpected character at line 1 column 1 of the JSON data
Stack trace:
jQuery.parseJSON@http://localhost:3000/assets/jquery.js?body=1:8483:3
ajaxConvert@http://localhost:3000/assets/jquery.js?body=1:8809:8
done@http://localhost:3000/assets/jquery.js?body=1:9226:4
.send/callback@http://localhost:3000/assets/jquery.js?body=1:9686:8

```

Is there anything to do on the rails server so it outputs proper JSON for jquery?