I have not found if devise does what you ask (the question relates to the second: the confirmation_ email field, similar to: password_confirmation, "confirmable", seems to be related exclusively to confirmation links). I had to do this too, and I figured out how to do this using the built-in check of the active record (rails 3.2.8, development 2.1.2):
- In your model, add
confirmation: true to your email check and from :email_confirmation to attr_accessible . - In the viewing field, add the field
:email_confirmation .
As an example, in your model (without assuming other checks or attr_accessibles):
attr_accessible :email, :email_confirmation validates :email, confirmation: true
which will use the built-in active record โconfirmationโ of verification (the same as for passwords). Finally, in your views you need to add something like:
<div><%= f.label :email_confirmation %> <%= f.email_field :email_confirmation %></div>
There might be a cleaner way, but it worked for me. However, my only development experience so far has been to add it to existing models, I have not used it when creating models for you (presumably this is basically the same).
source share