rails/rails — Issue #4796: Default responder doesn't honor the overwritten response block
Author: sikachu
Created: 2012-01-31 16:04:41+00:00
State: open
Labels: 3-2-stable, bug, regression

Consider this snippet:

```ruby
def create
@user = User.create(params[:user])
respond_with(@user) do |format|
format.json do
if @user.errors.blank?
render :json => @user
else
render :json => @user.errors
end
end
end
end
```

The given block will get passed into the responder as a `:default_response`(https://github.com/rails/rails/blob/v3.2.1/actionpack/lib/action_controller/metal/mime_responds.rb#L231-240) Hoever, it will not get called due to the fact that `to_format` does not honor the `:default_response` at all (https://github.com/rails/rails/blob/v3.2.1/actionpack/lib/action_controller/metal/responder.rb#L174-182). I think we should fix this to allow the override.

Setting this to 3.2.2, and I will work on this.