I\'ve seemingly set up Devise for my User authentication, with the :confirmable option set.
Everything seems to run fine when I run it in the browser, I sign up, go
It simply turned out that when I ran rails generate devise:views
, it generated incorrect paths when compared to the routes devise_for :user
generated. It also generated some other issues, such as the user_confirmation_url
pointing to @resource, as the first parameter; when it shouldn't have.
(I didn't want the question to be left unanswered, I'm unsure as to the typical etiquette. If I'm wrong in doing this, please let me know).
I also had the same issue just doing restart my server do the job for me and this error removed.
just do CTRL + c and then start your server using rails s
As an additional, if you're using STI with Devise models, as I am, you can check via the type attribute. So, my code looks like this:
<p><%= link_to 'Confirm my account', manager_confirmation_url(:confirmation_token => @resource.confirmation_token) if @resource.type == 'Manager' %></p>
<p><%= link_to 'Confirm my account', subscriber_confirmation_url(:confirmation_token => @resource.confirmation_token) if @resource.type == 'Subscriber' %></p>