0
votes

I ran into a strange routing problem with Devise. Recently I added email confirmation through Devise for my Rails app and I was trying to setup the confirmation/new action so that users could have their email confirmations re-sent post-registration.

So here's my current route setup for my Devise user authentication:

devise_for :users do    
    match 'users/logout' => 'devise/sessions#destroy'
end

And after running rake routes this is what I get for the pertinent new confirmation path that I want:

new_user_confirmation GET    /users/confirmation/new(.:format)     {:action=>"new", :controller=>"devise/confirmations"}

My link to the new confirmation email action is as so:

<%= link_to "Didn't receive unlock instructions?", new_user_confirmation %>

Clicking on this link redirects me to the url /users/confirmation/new.user but I get the routing error:

Routing Error

No route matches {:controller=>"devise/tournaments", :action=>"results"}

Which is strange to me because Devise has nothing to do with my tournaments controller nor is my tournaments controller ever referenced on any devise-related functionality.

I'm using Rails 3.1 and Devise 2.1.2

1

1 Answers

0
votes

The problem actually stemmed from my Application layout of all places. Thus far the only devise views I've had to deal with are the registration view and sign_up view, neither of which render the layout by default. Naturally I made the assumption that this page wouldn't either so I didn't know to keep an eye out for it.

In my application layout I had a route linking to the above :controller=>"devise/tournaments", :action=>"results" simply changing this to the named routetournament_results_path solved my problem.