Ruby on rails Rails路由器不';我看不到方法柱
在routes.rb中,我有一行:Ruby on rails Rails路由器不';我看不到方法柱,ruby-on-rails,Ruby On Rails,在routes.rb中,我有一行: resources :comments 但当我谈到/评论/创建时,我看到: No route matches [POST] "/comments/create" 怎么了?类和操作存在。查看rake routes输出中的第2行。 您应该发布到/comments,以启动创建操作 comments_path GET /comments(.:format) comments#index
resources :comments
但当我谈到/评论/创建时,我看到:
No route matches [POST] "/comments/create"
怎么了?类和操作存在。查看
rake routes
输出中的第2行。
您应该发布到/comments
,以启动创建
操作
comments_path GET /comments(.:format) comments#index
POST /comments(.:format) comments#create
new_comment_path GET /comments/new(.:format) comments#new
edit_comment_path GET /comments/:id/edit(.:format) comments#edit
comment_path GET /comments/:id(.:format) comments#show
PATCH /comments/:id(.:format) comments#update
PUT /comments/:id(.:format) comments#update
DELETE /comments/:id(.:format) comments#destroy