Fix using raw body for js requests.

At the moment it uses raw body for all non-html requests. This breaks ajax forms (remote: true) because it replaces params[:model] with raw request body.

I suppose this should happen only for json requests.