heartcombo / devise

Flexible authentication solution for Rails with Warden.
http://blog.plataformatec.com.br/tag/devise/
MIT License
23.91k stars 5.54k forks source link

No route matches "/sessions/user" #520

Closed shenoudab closed 14 years ago

shenoudab commented 14 years ago

Dears,

Kindly, i got that worning and Error when using Devise master with Rails 3

Started GET "/users/sign_in" for 127.0.0.1 at 2010-09-22 16:31:29 +0300 Processing by Devise::SessionsController#new as HTML Rendered devise/shared/_links.erb (3.1ms) Rendered devise/sessions/new.html.erb within layouts/login (14.1ms) Completed 200 OK in 211ms (Views: 20.8ms | ActiveRecord: 0.0ms)

Started POST "/sessions/user" for 127.0.0.1 at 2010-09-22 16:31:39 +0300

ActionController::RoutingError (No route matches "/sessions/user"):

Best Regards, Shenouda Bertel

josevalim commented 14 years ago

Please, please when posting issues try to include the maximum information as possible. What are your routes? Have you modified devise controller? Which Devise version? Can you provide a failing example application? Or a test in devise test suite?

shenoudab commented 14 years ago

about the routes : devise_for :users

devise_scope :user do get "/login" => "devise/sessions#new" get "/logout" => "devise/sessions#destroy" get "/signup" => "devise/registrations#new" end

Modifying Devise controller .. No Devise Version 1.2.0 master.

about the failing example application : a default basic devise usage. also, i run rake test on devise without any failures.

Regards, Shenouda Bertel

josevalim commented 14 years ago

We need your full config/routes.rb, it seems looks like a routes conflict (try removing all routes and just leaving devise sign_in one). We have a few Rails 3 apps using Devise master and they all work like a charm.

shenoudab commented 14 years ago

Thanks Jose,

i cleared my routes, and every thing works fine again. the problem was because of "resources :sessions" which make conflict. but that "resources :sessions" was inside constraint as :

constraints(Subdomain) do resources :sessions end

did you have any idea why is not restricted with the constraint condition.

Thanks again, and sorry for disturbance.

josevalim commented 14 years ago

No problem! Just notice that Rails don't check the constraints on routes generation (otherwise it would be very very slow).