开发者

devise registration confirmation freezes when I click email confirm link

I'm getting some strange behavior when testing on my local machine:

1) First of all when I sign-up, I'm redirected to the home page and I see a flash message that says:

 "You have signed up successfully. However, we could not sign you in because your account is unconfirmed."

I find it strange to see a warning type message when the user is merely on the right path to creating an account. I could easily change the message in /locales/devise.en.yml, but I just wanted to confirm this was the default behavior of devise, and not something wrong with my setup?

2) I successfully receive an email with a confirmation link:

<p>You can confirm your account through the link below:</p>

<p><a href="http://localhost:5000/accounts/confirmation?confirmation_token=MywxHuW3PWHvg6x2nUfG&amp;format=">Confirm my account</a></p>

When I click on the email confirmation link, I see a blank web page.

the development log shows:

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.att开发者_如何学Cnum
   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

"Not Acceptable" it says? What does that mean? Did it go through or not? What happened?


I figured it out. Apparently the link contained a "&format=" parameter at the end of the link. The devise views for emails were injecting the @resource causing the id of the resource to be put in as the format of the url (in this case it's blank because I'm using params_to and the artist nickname as the id, and there is some other issue I'm having with that not being populated... not related to this problem). I fixed the views and that has fixed the problem.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜