This seems to be basic but I’m a Ruby/Rails beginner. I need to simply return HTTP 204 in a controller.
Would
respond_to do |format|
format.html
end
return a 204?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Tested with Rails 3.2.x, 4.x. It causes the controller method to respond with the 204 No Content HTTP status code.
An example of using this inside a controller method named
foobar: