No route matches [POST] "/sessions/user"
I just installed Devise on my app, I had previously done it by scratch
like Michael Hartl tutorial.
Currently I can sign up and log out. But when I do log in it gives an error:
No route matches [POST] "/sessions/user"
it happens when I click on the sign in/log in button with or without the
(correct) password.
My route file is:
SampleApp::Application.routes.draw do
devise_for :users, path_names: { sign_in: "login", sign_out: "logout"}
resources :users do
resources :bookings, only: [:show]
end
resources :bookings
resources :sessions
# match '/signup', to: 'devise/registrations#new', via: :get
# match '/signin', to: 'devise/sessions#new', via: [:post, :get]
# match '/signout', to: 'devise/sessions#destroy', via: :delete
match '/admin', to: 'admin#new', via: :get
match "bookings/new", to: 'bookings#new', via: [:post, :get]
devise_scope :user do
root to: 'static_pages#home'
end
Thanks in advance!
No comments:
Post a Comment