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?

-- 
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Core" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to rubyonrails-core+unsubscr...@googlegroups.com.
To post to this group, send email to rubyonrails-core@googlegroups.com.
Visit this group at https://groups.google.com/group/rubyonrails-core.
For more options, visit https://groups.google.com/d/optout.

Reply via email to