在Devise
中,在更新用户后,它会自动重定向,但我想只返回JSON,因为我正在构建SPA。我尝试了以下
def after_update_path_for(resource)
{ updated: true }
end
但它仍然通过
重定向此参数Turbolinks.visit("http://localhost:3000/users?update=true", {"action":"replace"})
渲染JSON会产生双重渲染错误。
我可以禁用重定向并仅渲染JSON吗?