0

教程表明如果我运行rake routes这应该是预期的

$ rake routes
    posts GET    /posts(.:format)          posts#index
          POST   /posts(.:format)          posts#create
 new_post GET    /posts/new(.:format)      posts#new
edit_post GET    /posts/:id/edit(.:format) posts#edit
     post GET    /posts/:id(.:format)      posts#show
          PATCH  /posts/:id(.:format)      posts#update
          PUT    /posts/:id(.:format)      posts#update
          DELETE /posts/:id(.:format)      posts#destroy
     root        /                         welcome#index

但是当我发出命令时,这只会出现

welcome_index GET /welcome/index(.:format) welcome#index
         root     /                        welcome#index

这背后的原因可能是什么?

链接 - http://edgeguides.rubyonrails.org/getting_started.html

4

1 回答 1

0

您需要将以下内容添加到routes.rb

resources :posts
于 2013-06-08T10:27:13.410 回答