As I was writing a controller action with Rails 5, I had to respond with an empty successful response. In the past, I simply did render nothing: true. To achieve the same result without the deprecation warning I had to switch to using the head method. No problem, but my first instinct was to supply :success as the status, which caused the server to respond with an “Internal Server Error” with no stack trace, which was confusing. It took me 5-10 minutes to realize I was using the wrong status code. I switched to :ok and the problem went away.
Would it make sense for the head method attempt to validate that a valid status code is being passed in?