This is a question \"why does it work this way\", not \"how do I make this work\".
My app is calling a third party REST API that returns JSON, and returning the result a
The 'why' has been answered excellently by @david-james. This is just a short 'how' to answer via respond_with:
respond_with
class Api::V1::UsersController < ApplicationController respond_to :json def create @user = User.create(...) respond_with @user, location: url_for([:api, :v1, @user]) end end