你好,我正在做 Rails Book 的教程,遇到了一些麻烦。
当我尝试使用我的用户名和密码登录时,我收到以下错误:
路由错误
没有路由匹配 [POST] "/sessions/new" 尝试运行 rake 路由以获取有关可用路由的更多信息。
这是我的路由文件配置。
ZomfgShop::Application.routes.draw do
get "admin/index"
get "sessions/new"
get "sessions/create"
get "sessions/destroy"
resources :users
resources :orders
resources :line_items
resources :carts
get "store/index"
resources :products do
get :who_bought, on: :member
end
resources :products
root to: 'store#index', as: 'store'
resources :line_items do
#member do
# post 'decrement'
#end
post 'decrement', on: :member
end
get 'admin' => 'admin#index'
controller :sessions do
get 'login' => :new
post 'login' => :create
delete 'logout' => :destroy
end