In my controller, I have this:
class TestController < ApplicationController respond_to :html, :json
This is great when I create test , it redirects to test#index (as expected), but if I press F5 , the browser will ask me to resubmit the form.
If I remove the location statement from respond_with , it works fine, but does not go to the url I want.
How can i fix this?
Thanks in advance.
EDIT
I change my method to
@test = current_user.tests.new(params[:transaction]) respond_with(@test) do |format| format.html { redirect_to "/tests/" } if @test.save end
And it works .. but, it was strange, I had to use String instead of tests_url .
EDIT 2
See full sample code and bug report .
EDIT 3
I cannot play it with Ruby 1.9.3-p327, only at -p385.
source share