No route matches {:controller=>"devise/welcome"} #471

fcioffi opened this Issue Sep 6, 2010 · 14 comments

9 participants


After standard instruction

I have:

No route matches {:controller=>"devise/welcome"}

Plataformatec member

You are surely doing something unexpected, as we have no "devise/welcome" controller and we for sure don't mention it anywhere in the source code or README.


The error appear at the line code:

<%= link_to "Home", :controller => "welcome", :action => "index" %>

Plataformatec member

Where is it from? From your app? What are your routes? We can have thousands of reasons to get such an error. Can you reproduce it in a smaller app?


insert it into application.html.erb


Temporary solution:
change the link adding a slash
<%= link_to "Home", :controller => "/welcome", :action => "index" %>

Did you reproduce the error? I have a smaller app for you, can I send it?

Thanks for reply!


I also have this problem and so far as I can deduce it is caused by the link_to function scoping to the devise middleware. Within the rest of the site the link_to within the layout works as expected generating a link which points to the various controllers within the rails app however if those links are generated when the current page is part of devise (login, logout etc..) then the devise middleware is interrogated for the controller and thus returns errors. This causes a significant hindrance and it would be useful to get it fixed.


Was there ever a resolution to this, I have the same problem (2.3.10 app upgraded to rails 3.0.3) it would be great to know if we still have to work around this, or if it can be fixed. (I'll dig into devise Tomorrow to look for myself)



The issue is probably not using RESTful routes in your rails 2 link_to functions. Like roja said, the pages generated by devise do not like the old link_to "foo", :controller => :bar, :action => :baz syntax. I had the same problem with a new rails 3 app that I had put the old style links in, adding resources in routes.rb and using the new controller helpers fixed the issue.



What do you mean by "the new controller helpers"?



There are functions in rails 3.2 that still uses the old link_to syntax, which broke controller scope for devise. Ex. current_page? and link_to_if


Is it invalid to use the old action/controller syntax for link_to? Not everything is RESTful, after all. If it's not, I think it might not be fair to consider this issue closed, as it does seem to affect current versions.

Plataformatec member

Thanks for the clarification! I'm going to double-check my / prefixing, but I'll attempt to use the named helpers in every case I can.


I get this error when I use

<%= link_to('Login', new_user_session_path)  %> 


<%= link_to('Register', new_user_registration_path)  %>

routes.rb is:

        new_user_session GET    /users/sign_in(.:format)               devise/sessions#new
            user_session POST   /users/sign_in(.:format)               devise/sessions#create
    destroy_user_session DELETE /users/sign_out(.:format)              devise/sessions#destroy
 user_omniauth_authorize        /users/auth/:provider(.:format)        devise/omniauth_callbacks#passthru {:provider=>/(?!)/}
  user_omniauth_callback        /users/auth/:action/callback(.:format) devise/omniauth_callbacks#(?-mix:(?!))
           user_password POST   /users/password(.:format)              devise/passwords#create
       new_user_password GET    /users/password/new(.:format)          devise/passwords#new
      edit_user_password GET    /users/password/edit(.:format)         devise/passwords#edit
                         PUT    /users/password(.:format)              devise/passwords#update
cancel_user_registration GET    /users/cancel(.:format)                devise/registrations#cancel
       user_registration POST   /users(.:format)                       devise/registrations#create
   new_user_registration GET    /users/sign_up(.:format)               devise/registrations#new
  edit_user_registration GET    /users/edit(.:format)                  devise/registrations#edit
                         PUT    /users(.:format)                       devise/registrations#update
                         DELETE /users(.:format)                       devise/registrations#destroy
       user_confirmation POST   /users/confirmation(.:format)          devise/confirmations#create
   new_user_confirmation GET    /users/confirmation/new(.:format)      devise/confirmations#new
                         GET    /users/confirmation(.:format)          devise/confirmations#show
             user_unlock POST   /users/unlock(.:format)                devise/unlocks#create
         new_user_unlock GET    /users/unlock/new(.:format)            devise/unlocks#new
                         GET    /users/unlock(.:format)                devise/unlocks#show
              home_index GET    /home/index(.:format)                  home#index
                    root        /                                      Home#index
               dashboard        /dashboard(.:format)                   dashboard#index
                  assess        /assess(.:format)                      assess#index
                    plan        /plan(.:format)                        plan#index
                 execute        /execute(.:format)                     execute#index
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment