Rails render :text vs render :plain
Use render :plain if you want the Rails controller to return plain text.
From Prem in https://github.com/rails/rails/issues/12374:
Per discussion,
render :text
misdirect people to think that it would render content withtext/plain
MIME type. However,render :text
actually sets the response body directly, and inherits the default response MIME type, which istext/html
.