I am the newbie of the ROR and I am going through the Ruby on Rails official guide (4.2.6), but I got one problem when I want to add the Article model.
When I am trying to save the article I got the error,
undefined method `article_url' for # Did you mean? articles_url
I found that the route don't have the "article" prefix in my route:
majiandeMacBook-Pro:blog majian$ bin/rake routes Running via Spring preloader in process 26766 Prefix Verb URI Pattern Controller#Action welcome_index GET /welcome/index(.:format) welcome#index root GET / welcome#index articles POST /articles(.:format) articles#create new_articles GET /articles/new(.:format) articles#new edit_articles GET /articles/edit(.:format) articles#edit GET /articles(.:format) articles#show PATCH /articles(.:format) articles#update PUT /articles(.:format) articles#update DELETE /articles(.:format) articles#destroy
But in the document, I found that it should be like this:
article GET /articles/:id(.:format) articles#show
Does anybody know why the routes are different? Any help will be appreciated.