ActionController: Passing a block to respond_with does not run the responder. #5280

Closed
mariovisic opened this Issue Mar 5, 2012 · 0 comments

2 participants

@mariovisic

In my application i'm using the flash responder provided by the responders gem (http://github.com/plataformatec/responders)
When upgrading to rails 3.2.2 from 3.2.1 some of my flash messages stopped working. If I have a regular respond with then it works fine. So this works fine

def my_action
  respond_with current_user
end

But if I give respond_with a block then it no longer displays the flash messages. This used to work but no longer works:

def my_action
  respond_with current_user do |format|
    format.html { redirect_to root_url }
  end
end

It seems as though the responder is never called when a block is defined for respond_with. I have managed to get a failing test case over here mariovisic@defa362

I've had a tinker to fix the problem but without any luck. Was wondering if someone could take a look?

Cheers

@sikachu sikachu was assigned Mar 5, 2012
@sikachu sikachu added a commit to sikachu/rails that referenced this issue Mar 6, 2012
@sikachu sikachu Always passing a respond block from to responder
We should let the responder to decide what to do with the given
overridden response block, and not short circuit it.

Fixes #5280
284041c
@sikachu sikachu added a commit that closed this issue Mar 6, 2012
@sikachu sikachu Always passing a respond block from to responder
We should let the responder to decide what to do with the given
overridden response block, and not short circuit it.

Fixes #5280
82a8698
@sikachu sikachu closed this in 82a8698 Mar 6, 2012
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment