In rails it is common practice to send a "head :ok" in response to a request. (https://github.com/search?l=Ruby&p=7&q=%22head+%3Aok%22&type=Code&utf8=%E2%9C%93)
Is it possible to send an json hash along with it?
In rails it is common practice to send a "head :ok" in response to a request. (https://github.com/search?l=Ruby&p=7&q=%22head+%3Aok%22&type=Code&utf8=%E2%9C%93)
Is it possible to send an json hash along with it?
Is it possible to send an json hash along with it?
No.
head :ok
sets render
to return an empty response (so just the header, no body) with status 200. head :ok
is shorthand for render nothing: true, status: :ok
.
Here's a list of all the :status
options you can use for setting the appropriate status code.