Devise confirmable not working in newest version?

Look and see if you copied the have devise views, they may be out of date.

Up vote 2 down vote favorite 1 share g+ share fb share tw.

I recently upgraded from Devise 1.2 to 1.4.9 and everything seems to work except my confirmable module. Email works as well as the entire process. But the confirmation page is always blank.

It works and it confirms the email account, but it does not redirect the user and throws a 406 error. It does the same for false confirmation attempts. Routes seem to work fine, I have confirmable specified in my user model, and nothing else has changed.

Any ideas? Am I missing some settings or something I need to update for 1.4.9? UPDATE It seems to be a problem with the URL being generated.

For some unknown reason it is prepending the confirmations URL with the user name? And that is causing it to break. But i'm still not sure how to fix it.

http://localhost:5000/users/confirmation. Someusername? Confirmation_token=R7apAPhC5c3rszvhsowp The username in the URL above causes the process not to work.

I checked the diff between the controller in 1.2 (which works) and the new version. 1.2 # GET /resource/confirmation? Confirmation_token=abcdef def show self.

Resource = resource_class. Confirm_by_token(params:confirmation_token) if resource.errors. Empty?

Set_flash_message :notice, :confirmed sign_in_and_redirect(resource_name, resource) else render_with_scope :new end end 1.4.9 # GET /resource/confirmation? Confirmation_token=abcdef def show self. Resource = resource_class.

Confirm_by_token(params:confirmation_token) if resource.errors. Empty? Set_flash_message(:notice, :confirmed) if is_navigational_format?

Sign_in(resource_name, resource) respond_with_navigational(resource){ redirect_to after_confirmation_path_for(resource_name, resource) } else respond_with_navigational(resource. Errors, :status => :unprocessable_entity){ render_with_scope :new } end end protected # The path used after resending confirmation instructions. Def after_resending_confirmation_instructions_path_for(resource_name) new_session_path(resource_name) end # The path used after confirmation.

Def after_confirmation_path_for(resource_name, resource) after_sign_in_path_for(resource) end error Started GET "/users/confirmation. Sdfsdfsd? Confirmation_token=vmxmx73xvM7sUfcvH9CX" for 127.0.0.1 at 2011-10-31 13:30:33 +0100 Processing by Devise::ConfirmationsController#show as Parameters: {"confirmation_token"=>"vmxmx73xvM7sUfcvH9CX"} SQL (1.1ms) 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 = '"users"'::regclass AND a. Attnum > 0 AND NOT a. Attisdropped ORDER BY a.

Attnum User Load (1.2ms) SELECT "users". * FROM "users" WHERE "users". "confirmation_token" = 'vmxmx73xvM7sUfcvH9CX' LIMIT 1 SQL (0.7ms) 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 = '"users"'::regclass AND a. Attnum > 0 AND NOT a. Attisdropped ORDER BY a.

Attnum Completed 406 Not Acceptable in 28ms ruby-on-rails ruby-on-rails-3 authentication devise link|improve this question edited Nov 3 '11 at 14:53 asked Oct 31 '11 at 12:42holden2,1421855 58% accept rate.

It is obvious that url is causing 406 /users/confirmation. Someusername?... ". Someusername" (includes dot) will be treated as format of response you want back.

So maybe if you try prepand route rule in your route. Rb file could fix this get /users/confirmation. :username", :controller => :users, :action=> confirmation ... – Milan Jaric Nov 3 '11 at 15:02.

Look and see if you copied the have devise views, they may be out of date. I had a similar issue getting odd user ids in my url, devise no longer uses user_confirmation_url in favor of confirmation_url (as of 1.0? , but it still worked a bit longer) so you might either delete your custom devise views or update the url helper.

Someone else pointed me in the right direction but here's my exact solution. The problem was in the devise view templates which I had copied over from 1.2? It looks like they changed the link helper from user_confirmation_url() to simply confirmation_url().

Old confirmation email Welcome! You can confirm your account through the link below: @resource. Confirmation_token) %> new confirmation template Welcome!

You can confirm your account through the link below: @resource. Confirmation_token) %.

I cant really gove you an answer,but what I can give you is a way to a solution, that is you have to find the anglde that you relate to or peaks your interest. A good paper is one that people get drawn into because it reaches them ln some way.As for me WW11 to me, I think of the holocaust and the effect it had on the survivors, their families and those who stood by and did nothing until it was too late.

Related Questions