Skip to content

status: 422 when rendering errors

Alex edited this page May 7, 2015 · 1 revision

We had a line that returned a 422 response code on create failure:

# app/controllers/accounts_controllers.rb
  response_for :create_fails do
    ...
    render :action => 'new', :status => 422

This was introduced in 6eebf59b. The commit message states that this was to make the behaviour consistent with make_resourceful. We can safely assume that 422 was introduced in other places for the same reason. We see no use case for handing the 422 response.