【发布时间】:2015-08-24 22:32:55
【问题描述】:
Rails 新手。有个问题。
使用 Devise 请求更改密码后,它希望重定向到某个路径。我已经使用以下方法覆盖了这条路径:
protected def after_sending_reset_password_instructions_path_for(resource_name)
root_path
end
但是,在我弄清楚如何让 JSON 对象传回我现在使用 AJAX 的“忘记密码”页面之前,这确实是一个权宜之计。有没有办法在发送重置密码指令而不是重定向后将 JSON 对象传回调用 Forgot 页面?
编辑:
添加了 PasswordsController 及其外观:
class Portal::PasswordsController < Devise::PasswordsController
def create
super
end
end
再次感谢。
【问题讨论】:
标签: ruby-on-rails ruby-on-rails-4 devise