0

我正在为我的 Rails 3.2.9 应用程序使用设计。注册后不会出现与确认相关的通知(如下 devise.en.yml 文件中的 en、devise、confirms 下)。注册后,用户在没有任何通知的情况下被重定向到登录页面,但电子邮件已发送。一旦用户点击电子邮件中的确认链接,他就会被重定向到应用程序的欢迎页面,再次没有任何关于登录或注册成功的通知

设计.en.yml:

en:
  devise:
    confirmations:#THESE ARE NOT WORKING
      confirmed: "Your account was successfully confirmed. You are now signed in."
      send_instructions: "You will receive an email with instructions about how to confirm your account in a few minutes."
      send_paranoid_instructions: "If your email address exists in our database, you will receive an email with instructions about how to confirm your account in a few minutes."
    failure:#WORKS
      already_authenticated: "You are already signed in."
      inactive: "Your account was not activated yet."
      invalid: "Invalid email or password."
      invalid_token: "Invalid authentication token."
      locked: "Your account is locked."
      not_found_in_database: "Invalid email or password."
      timeout: "Your session expired, please sign in again to continue."
      unauthenticated: "You need to sign in or sign up before continuing."
      unconfirmed: "You have to confirm your account before continuing."
    mailer:
      confirmation_instructions:
        subject: "Confirmation instructions"
      reset_password_instructions:
        subject: "Reset password instructions"
      unlock_instructions:
        subject: "Unlock Instructions"
     #some code..

编辑:

en:
  devise:
    confirmations:
      confirmed: "Your account was successfully confirmed. You are now signed in."
      send_instructions: "You will receive an email with instructions about how to confirm your account in a few minutes."
      send_paranoid_instructions: "If your email address exists in our database, you will receive an email with instructions about how to confirm your account in a few minutes."
    failure:
      already_authenticated: "You are already signed in."
      inactive: "Your account was not activated yet."
      invalid: "Invalid email or password."
      invalid_token: "Invalid authentication token."
    -----------#SOME CODE---------------
    user_registrations:
      user:
        destroyed: "Bye! Your account was successfully cancelled. We hope to see you again soon."
        signed_up: "Welcome! You have signed up successfully."
        signed_up_but_inactive: "You have signed up successfully. However, we could not sign you in because your account is not yet activated."
        signed_up_but_locked: "You have signed up successfully. However, we could not sign you in because your account is locked."
        signed_up_but_unconfirmed: "A message with a confirmation link has been sent to your email address. Please open the link to activate your account."
        update_needs_confirmation: "You updated your account successfully, but we need to verify your new email address. Please check your email and click on the confirm link to finalize confirming your new email address."
        updated: "You updated your account successfully."
     -----------#SOME CODE---------------
4

1 回答 1

0

您必须在 application.html.erb 中添加以下行:

<p class="notice"><%= notice %></p>
<p class="alert"><%= alert %></p>
于 2013-05-24T05:24:42.153 回答