爲什麼我的redirect_to :back
不起作用?它只是重定向到同一頁面。活動管理員重定向to_back不起作用
我的方法
controller do
def update
update! do |success, failure|
success.html { redirect_to :back }
end
end
end
我request.referer
回報我,我的電流路徑
爲什麼我的redirect_to :back
不起作用?它只是重定向到同一頁面。活動管理員重定向to_back不起作用
我的方法
controller do
def update
update! do |success, failure|
success.html { redirect_to :back }
end
end
end
我request.referer
回報我,我的電流路徑
我知道這是舊的。我試圖解決同樣的問題。並找到了做到這一點的方法。所以我在這裏分享。基於
這個代碼here
這就是爲什麼我們在ActiveAdmin
ActiveAdmin::Dependency.rails.redirect_back self, active_admin_root
希望能夠幫助重定向回。
我在我的使用案例url_for(:back)
中取得了很好的成功。我特意使用它,但我猜想它可以在其他地方使用
form do |f|
f.actions do
f.action :submit
f.cancel_link(url_for(:back))
end
end