Redirect_to 声称有效,但实际上并没有在浏览器中发生
Redirect_to claims to work, but doesn't actually happen in the browser
这是我调用重定向的控制器代码:
def helpful
flash[:notice] = I18n.t(:thanks_for_feedback)
redirect_to :back
end
日志声明:
Redirected to http://localhost:3000/p/anime/2?page=1
Completed 302 Found in 3147.7ms (Searchkick: 857.1ms)
但是,浏览器中实际上什么也没有发生(Chrome,如果重要的话)。
可能您正在使用 AJAX 请求。
如果是的话,看一下:Rails 3: How to "redirect_to" in Ajax call?
这是我调用重定向的控制器代码:
def helpful
flash[:notice] = I18n.t(:thanks_for_feedback)
redirect_to :back
end
日志声明:
Redirected to http://localhost:3000/p/anime/2?page=1
Completed 302 Found in 3147.7ms (Searchkick: 857.1ms)
但是,浏览器中实际上什么也没有发生(Chrome,如果重要的话)。
可能您正在使用 AJAX 请求。
如果是的话,看一下:Rails 3: How to "redirect_to" in Ajax call?