在本地机器上测试时出现一些奇怪的行为:
1) 首先,当我注册时,我被重定向到主页,我看到一条消息说:
"You have signed up successfully. However, we could not sign you in because your account is unconfirmed."
当用户只是在正确的路径上创建帐户时,我发现看到警告类型的消息很奇怪。我可以轻松更改 /locales/devise.en.yml 中的消息,但我只是想确认这是设计的默认行为,而不是我的设置有什么问题?
2) 我成功收到一封带有确认链接的电子邮件:
<p>You can confirm your account through the link below:</p>
<p><a href="http://localhost:5000/accounts/confirmation?confirmation_token=MywxHuW3PWHvg6x2nUfG&format=">Confirm my account</a></p>
当我单击电子邮件确认链接时,我看到一个空白网页。
开发日志显示:
Started GET "/accounts/confirmation?confirmation_token=MywxHuW3PWHvg6x2nUfG&format=" for 127.0.0.1 at 2011-09-28 09:41:55 -0700
Processing by Devise::ConfirmationsController#show as
Parameters: {"confirmation_token"=>"MywxHuW3PWHvg6x2nUfG"}
SQL (0.9ms) SELECT a.attname, format_type(a.atttypid, a.atttypmod), d.adsrc, a.attnotnull
FROM pg_attribute a LEFT JOIN pg_attrdef d
ON a.attrelid = d.adrelid AND a.attnum = d.adnum
WHERE a.attrelid = '"artists"'::regclass
AND a.attnum > 0 AND NOT a.attisdropped
ORDER BY a.attnum
Artist Load (0.4ms) SELECT "artists".* FROM "artists" WHERE "artists"."confirmation_token" = 'MywxHuW3PWHvg6x2nUfG' LIMIT 1
SQL (0.8ms) SELECT a.attname, format_type(a.atttypid, a.atttypmod), d.adsrc, a.attnotnull
FROM pg_attribute a LEFT JOIN pg_attrdef d
ON a.attrelid = d.adrelid AND a.attnum = d.adnum
WHERE a.attrelid = '"artists"'::regclass
AND a.attnum > 0 AND NOT a.attisdropped
ORDER BY a.attnum
SQL (0.2ms) BEGIN
AREL (0.9ms) UPDATE "artists" SET "confirmation_token" = NULL, "confirmed_at" = '2011-09-28 16:41:55.894603', "updated_at" = '2011-09-28 16:41:55.895467' WHERE "artists"."id" = 85
[paperclip] Saving attachments.
SQL (0.8ms) COMMIT
SQL (0.1ms) BEGIN
AREL (0.5ms) UPDATE "artists" SET "last_sign_in_at" = '2011-09-28 16:41:55.915779', "current_sign_in_at" = '2011-09-28 16:41:55.915779', "last_sign_in_ip" = '127.0.0.1', "current_sign_in_ip" = '127.0.0.1', "sign_in_count" = 1, "updated_at" = '2011-09-28 16:41:55.916532' WHERE "artists"."id" = 85
[paperclip] Saving attachments.
SQL (0.5ms) COMMIT
Completed 406 Not Acceptable in 231ms
它说“不可接受”?这意味着什么?是通过还是没通过?发生了什么?