Rails,Devise,Validatable无法正常工作?(Rails, Devise, Validatable not working?)
我有Devise设置:在我的简单应用程序上有效,但我似乎无法获得注册注册表单,如果它发现错误就停止。
User.rb:
class User < ActiveRecord::Base # Include default devise modules. Others available are: # :confirmable, :lockable, :timeoutable and :omniauthable devise :database_authenticatable, :registerable, :recoverable, :rememberable, :trackable, :validatable ... end
截至目前,我有一个标准名称/电子邮件/密码/年龄字段的注册表单,当我提交没有失败的表单时,一切正常。
但是,如果我尝试创建一个我知道会失败的新用户(例如,创建一个已经存在电子邮件的用户),它仍然会尝试创建用户,而不是重定向回到注册表单,它将继续加载下一页,就好像它是一个有效的用户! 当然,在这一点上,我收到一个错误,因为它试图加载一个包含'current_user'代码的页面,并且用户不存在。
我甚至在哪里开始追踪这个? 不确定这是我安装Devise的方式,还是其他什么? 请帮忙。 谢谢!
I have Devise set up with :validatable on my simple app, but I can't seem to get the registration sign-up form to stop if it caught an error.
User.rb:
class User < ActiveRecord::Base # Include default devise modules. Others available are: # :confirmable, :lockable, :timeoutable and :omniauthable devise :database_authenticatable, :registerable, :recoverable, :rememberable, :trackable, :validatable ... end
As of now, I have a sign-up form with standard name/email/password/age fields, and everything works fine when I submit the form that doesn't fail.
But, if I try to create a new user that I know would fail (ex. create a user with an e-mail that already exists), it will still try to create the user, and instead of redirecting back to the sign-up form, it will continue to load the next page as if it was a valid user! Of course, at this point, I get an error because it tries to load up a page with 'current_user' code, and the user doesn't exist.
Where do I even begin to track this down? Not sure if it's the way I installed Devise, or something else?? Please help. Thanks!
原文:https://stackoverflow.com/questions/36024297
最新回答
命令格式为:man 你所想查询的命令比如想知道ls命令的作用跟用法:man ls
要想要中文改下语系就可以输入:lang=zh_cn.big5就可以,字符终端man的使用格式:man 要查看的对象我的linux上如:man date 会有下图的信息,具体参数建议查看资料。 会得到
相关问答
更多-
linux终端中怎么用man的手册,要中文的。[2022-02-01]
要想要中文改下语系就可以输入:LANG=zh_CN.big5就可以,字符终端man的使用格式:man 要查看的对象我的linux上如:man date 会有下图的信息,具体参数建议查看资料。 会得到 -
linux 不能查看curses的man手册[2022-05-31]
直接man curses -
JQuery UI 中文帮助手册[2021-09-20]
如果你是初学者 你看的不是Jqueryui 和jquery easyui, JqueryUI和jquery easyui 是Jquery的插件. 你应该看Jquery api才对。 Jquery API 1.4以上的中文版网上都有。 -
linux下 man中文手册[2023-05-29]
其实lz你只要安装linux时选择中文语言再安装上kde系统,那么你在图形桌面那终端使用man + 命令或者文件那么就会有手册了..系统自带的无需下载....不过汉化率比较差...基本上都是一些常规的命令有翻译...大部分都没有.....如果man中没有翻译那么可能使用:命令空格--help这些会列出常规的参数可能会有中文翻译。 -
plsql developer 中文使用手册[2022-11-02]
http://www.aybook.cn/soft/softdown.asp?softid=1981 -
zepto中文离线手册谁有,分享个[2020-11-19]
离线的没有,我都是看这个http://www.css88.com/doc/zeptojs_api/。大部分跟jquery是一样的,可以参考jquery的离线手册 -
如何把Linux中的中文man手册变回英文版[2022-06-12]
可以把系统语言设置为 英文,然后安装 英文的语言包,这样man就都回中文了。 -
mfc类库中文手册[2021-05-18]
已发 -
linux有API手册吗?[2022-06-15]
有命令行中输入man XXX XXX是包的名称或是命令名称或是程序库名称 如:man glibc就是glibc(GCC c lib)库中的函数介绍 要看有什么程序包用新立得打开可以搜索,点击下面就有描述 有些程序有开发包就会有dev包。如openoffice-dev就是开发openoffice插件的开发包,包含有相关函数库 -
练习linux常用命令及自定义man手册[2022-10-11]
收藏,学习下。多谢楼主哈