重置密码不重定向后设计自定义

时间:2015-04-24 22:32:42

标签: ruby-on-rails devise

class Users::PasswordsController < Devise::PasswordsController
  skip_before_filter :require_no_authentication, only: [:edit]

  def after_resetting_password_path_for(resource)
    completed_reset_path
    #super(resource)
  end

路线:

devise_for :users, controllers: { passwords: "users/passwords"}
match "completed_reset", to: 'home#completed_reset', via: [:get]

HomeController中:

class HomeController < ApplicationController
  def index
  end

  def completed_reset
  end
end

当我重置密码时,我被重定向到root而不是completed_reset_path。为什么会这样?

1 个答案:

答案 0 :(得分:0)

也许试试:

get 'completed_reset', :to => 'home#completed_reset'

而不是:

match "completed_reset", to: 'home#completed_reset', via: [:get]