尝试使 Devise 在错误注册时生成闪存错误消息。例如“电子邮件不能为空”或“密码太短”。
在查看 Railscast 第 210 集时,这似乎是 Devise 的开箱即用功能(通过 validatable),但在我的实例中,没有生成用于注册的 Flash 消息。请注意,闪现消息确实会在此应用程序的其他实例中生成,例如发送重置指令、删除帐户等...(如果您想亲自查看,可以在生产网站 ninjaspeak.com 上查看该行为)
对于为什么会这样有什么想法吗?
将 Devise 2.1.2 与 Rails 3.2.13 结合使用
devise.en.yml:
# Additional translations at https://github.com/plataformatec/devise/wiki/I18n
en:
errors:
messages:
expired: "has expired, please request a new one"
not_found: "not found"
already_confirmed: "was already confirmed, please try signing in"
not_locked: "was not locked"
not_saved:
one: "1 error prohibited this %{resource} from being saved:"
other: "%{count} errors prohibited this %{resource} from being saved:"
devise:
failure:
already_authenticated: 'You are already …Run Code Online (Sandbox Code Playgroud) 当我尝试git push heroku master命令时,我收到以下错误:
matt@matt-desktop:~/Documents/Ruby/rails_projects/ninja_speak_app$ git push heroku master
To https://git.heroku.com/limitless-inlet-4477.git
! [rejected] master -> master (fetch first)
error: failed to push some refs to 'https://git.heroku.com/limitless-inlet-4477.git'
hint: Updates were rejected because the remote contains work that you do
hint: not have locally. This is usually caused by another repository pushing
hint: to the same ref. You may want to first integrate the remote changes
hint: (e.g., 'git pull ...') before pushing again.
hint: See the 'Note about fast-forwards' in 'git …Run Code Online (Sandbox Code Playgroud)