Rails3 Devise Undefined Method 'Confirmation_Url'

Rails3 Devise undefined method `confirmation_url'

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).

Generating confirmation url in custom devise mailer

For anyone hitting this issue - I had the same method missing issue when using mandrill_mailer to replace devise's customer mailer.

Using the above example above I fixed it like so

class DeviseMailer < MandrillMailer::TemplateMaile

# ..... mailer code in here here .....

private

def main_app
Rails.application.routes.default_url_options[:host] = Rails.application.routes.default_url_options[:host]
Rails.application.routes.url_helpers
end

end

Customizing the confirmation_url in Devise

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

Rails3 + Devise: edit_password_url spits out http//www.blah.com (No colon the http!)

I ran into this problem too. The issue (oddly) is that you're using a full URL in the default_url_options (:host => 'http://www.blah.com'). If you put www.blah.com instead it appears to work. I ran into this problem last night and this was the quickest fix for me.

Can't confirm account for subdomain. Using Devise confirmable and Rails 4

I managed to solve this by using the following in confirmation_instructions.html.erb. This works for my setup, since I'm using the Apartment gem:

<%= link_to 'Confirm my account', user_confirmation_url(confirmation_token: @token, subdomain: Apartment::Tenant.current) %>

Devise reconfirmable email on Rails

Can you try modifying as below :

<p><%= link_to _('Confirm my account'), confirmation_url(@resource, confirmation_token: @token, locale: 'en') %></p>

replace en with your locale
Verify : ActionController::UrlGenerationError in Devise::Registrations#create



Related Topics



Leave a reply



Submit