rails设计edit_user_password_path [英] rails devise edit_user_password_path

查看:117
本文介绍了rails设计edit_user_password_path的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我无法路由到我的项目的edit_user_password_path。它只是路线到家里有人可以协助吗?

I cannot route to the edit_user_password_path on my project. It just routes to home. Can someone please assist?

<%= link_to更改密码,edit_user_password_path(current_user)%>

<%= link_to "Change Password", edit_user_password_path(current_user) %>

推荐答案

这个问题的答案解释了这个问题:
显示设计编辑密码屏幕

The answer to this question explains the issue: Showing the devise edit password screen

简而言之,当用户未登录时,PasswordsController用于重置密码。重新登录,它将重定向到根路径。

In brief, the PasswordsController is used for password resetting when a user is not signed in. If you're signed in, it redirects you to the root path.

为了编辑密码,您需要使用注册控制器。

In order to edit the password, you want to use the RegistrationsController instead.

这篇关于rails设计edit_user_password_path的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆