Ruby on rails 密码重置链接不存在';不要在轨道上使用装置

Ruby on rails 密码重置链接不存在';不要在轨道上使用装置,ruby-on-rails,ruby-on-rails-3,Ruby On Rails,Ruby On Rails 3,我已经在rails应用程序中重写了designe的密码控制器。但它不能正常工作。单击“重置密码链接”,有时调用密码#创建进入gem,有时进入覆盖的控制器。我的控制器看起来像: class Users::PasswordsController < Devise::PasswordsController layout 'lunchbox/lunchbox', only: [:lunchbox_forgot, :lunchbox_recover] def create sel

我已经在rails应用程序中重写了designe的密码控制器。但它不能正常工作。单击“重置密码链接”,有时调用密码#创建进入gem,有时进入覆盖的控制器。我的控制器看起来像:

class Users::PasswordsController < Devise::PasswordsController

  layout 'lunchbox/lunchbox', only: [:lunchbox_forgot, :lunchbox_recover]

  def create
    self.resource = resource_class.send_reset_password_instructions(resource_params)

    if successfully_sent?(resource)
      respond_with({}, :location => after_sending_reset_password_instructions_path_for(resource_name))
    else
      flash[:error] = "Email not found"
      redirect_path = params[:user][:lunchbox] ? lunchbox_forgot_password_path : new_user_password_path
      redirect_to redirect_path
    end
  end
end
class用户::密码控制器在发送\u重置\u密码\u指令\u路径\u(资源\u名称))
其他的
flash[:错误]=“未找到电子邮件”
重定向_path=params[:user][:午餐盒]?午餐盒\u忘记\u密码\u路径:新用户\u密码\u路径
重定向到重定向路径
结束
结束
结束

您是否将此添加到路线中
Desive_for:users,:controllers=>{:passwords=>“users/passwords”}
Yes,我添加了这样的内容:Desive_for:users,:controllers=>{:registrations=>“users/registrations”,:passwords=>“users/passwords”,:sessions=>“users/sessions”}