def respond_with_dual_blocks(object, options, &block) #:nodoc:
        args = (with_chain(object) << options)

        case block.try(:arity)
          when 2
            respond_with(*args) do |responder|
              blank_slate = InheritedResources::BlankSlate.new
              if object.errors.empty?
                block.call(responder, blank_slate)
              else
                block.call(blank_slate, responder)
              end
            end
          when 1
            respond_with(*args, &block)
          else
            options[:location] = block.call if block
            respond_with(*args)
        end
      end
def respond_with_dual_blocks(object, options, &block) #:nodoc:
        args = (with_chain(object) << options)

        case block.try(:arity)
          when 2
            respond_with(*args) do |responder|
              blank_slate = InheritedResources::BlankSlate.new
              if object.errors.empty?
                block.call(responder, blank_slate)
              else
                block.call(blank_slate, responder)
              end
            end
          when 1
            respond_with(*args, &block)
          else
            options[:location] = block.call if block
            respond_with(*args)
        end
      end
Used to allow to specify success and failure within just one block:

   def create
     create! do |success, failure|
       failure.html { redirect_to root_url }
     end
   end

 It also calculates the response url in case a block without arity is
 given and returns it. Otherwise returns nil.