What does `:location => ...` and `head :ok` mean in the 'respond_to' format statement?
Solution 1:
render ... :location => @user
will set the HTTP location header to inform the client of the location of the newly created resource (that is, its URL)head :ok
setsrender
to return an empty response (so just the header, no body) with status 200.head :ok
is shorthand forrender nothing: true, status: :ok
.
Here's a list of all the:status
options you can use for setting the appropriate status code.