Customizing the confirmation_url in Devise

devise, ruby-on-rails

Solution

I used this routing:

map.user_confirm 'confirm/:confirmation_token',
    :controller => 'confirmations', :action => 'show'

And this ERB:

<%= link_to 'Confirm my account',
    user_confirm_url(:confirmation_token => @resource.confirmation_token) %>

And got this nice link:

http://localhost:3000/confirm/RjOnrd5yNREEDwsEfiFa

Problem

How do you customize this default line generated by Devise in the mailer view? ``` <p><%= link_to 'Confirm my account', confirmation_url(@resource, :confirmation_token => @resource.confirmation_token) %></p> ``` I've written a method in my controller called `user_confirm`. And I have also defined a route for it. Can I get the URL to link to that method with token as the params?

Original source