Im setting up Devise authentication with my rails 3 project and when i click the sign in button, it displays :
No route matches "/session/user"
No matter if I use valid credentials or not..
Heres my form for devise (which i did NOT edit from the defaults)
<%= form_for(resource, :as => resource_name, :url => session_path(resource_name), :html => {:novalidate => 'novalidate'}) do |f| %>
Any suggestions?
UPDATE
Routes.rb
SpecimenTracker::Application.routes.draw do
devise_for :users
resources :users
resources :results
resources :session
match "/results/show" => "results#show"
match "/messages/show" => "messages#show"
match "/login/index" => "login#index"
match "/login/authenticate" => "login#authenticate"
# You can have the root of your site routed with map.root -- just remember to delete public/index.html.
get 'home/index'
root :to => 'home#index'
# See how all your routes lay out with "rake routes"
# Install the default routes as the lowest priority.
# Note: These default routes make all actions in every controller accessible via GET requests. You should
# consider removing the them or commenting them out if you're using named routes and resources.
end
Gemfile (only parts i added for devise)
gem 'net-ldap'
gem "dev开发者_如何学Goise", "~> 1.4"
gem "devise_ldap_authenticatable"
gem 'hpricot'
gem 'ruby_parser'
Output of rake routes (All the session on the bottom are from an old authentication system i tried using but then dumped. Shouldnt affect anything.. right? )
new_user_session GET /users/sign_in(.:format) {:controller=>"devise/sessions", :action=>"new"}
user_session POST /users/sign_in(.:format) {:controller=>"devise/sessions", :action=>"create"}
destroy_user_session DELETE /users/sign_out(.:format) {:controller=>"devise/sessions", :action=>"destroy"}
users GET /users(.:format) {:controller=>"users", :action=>"index"}
POST /users(.:format) {:controller=>"users", :action=>"create"}
new_user GET /users/new(.:format) {:controller=>"users", :action=>"new"}
edit_user GET /users/:id/edit(.:format) {:controller=>"users", :action=>"edit"}
user GET /users/:id(.:format) {:controller=>"users", :action=>"show"}
PUT /users/:id(.:format) {:controller=>"users", :action=>"update"}
DELETE /users/:id(.:format) {:controller=>"users", :action=>"destroy"}
results GET /results(.:format) {:controller=>"results", :action=>"index"}
POST /results(.:format) {:controller=>"results", :action=>"create"}
new_result GET /results/new(.:format) {:controller=>"results", :action=>"new"}
edit_result GET /results/:id/edit(.:format) {:controller=>"results", :action=>"edit"}
result GET /results/:id(.:format) {:controller=>"results", :action=>"show"}
PUT /results/:id(.:format) {:controller=>"results", :action=>"update"}
DELETE /results/:id(.:format) {:controller=>"results", :action=>"destroy"}
session_index GET /session(.:format) {:controller=>"session", :action=>"index"}
POST /session(.:format) {:controller=>"session", :action=>"create"}
new_session GET /session/new(.:format) {:controller=>"session", :action=>"new"}
edit_session GET /session/:id/edit(.:format) {:controller=>"session", :action=>"edit"}
session GET /session/:id(.:format) {:controller=>"session", :action=>"show"}
PUT /session/:id(.:format) {:controller=>"session", :action=>"update"}
DELETE /session/:id(.:format) {:controller=>"session", :action=>"destroy"}
results_show /results/show(.:format) {:controller=>"results", :action=>"show"}
messages_show /messages/show(.:format) {:controller=>"messages", :action=>"show"}
login_index /login/index(.:format) {:controller=>"login", :action=>"index"}
login_authenticate /login/authenticate(.:format) {:controller=>"login", :action=>"authenticate"}
home_index GET /home/index(.:format) {:controller=>"home", :action=>"index"}
root /(.:format) {:controller=>"home", :action=>"index"}
Check your config/routes.rb, is there a line for devise? If not, you may want to run
rails generate devise_install
And
rails generate devise User
精彩评论