I created a scaffold without problems
$ rails generate scaffold New name:string title:string content:text
Rake command to run the migration (no problems as before, table correctly created)
$ rake db:migrate
Edit app/views/home/index.html.erb
<%= link_to 'My News', :controller => 'news' %>
I see the home and the link correctly in "http://localhost:3000"; clicking the link "My news" page "http://localhost:3000/news" is loaded without errors.
Now, clicking in the link "New New" generated by Rails, link's target localhost:3000/news/new (source "<a href ="/news/new">New New</ a>"), i read this error:
Routing Error
No route matches {:action=>"show", :controller=>"news", :format=>nil}
Try running rake routes for more information on available routes.
In "app/views/news/index.html.erb" the link souce is
<%= link_to 'New New', new_news_path %>
In routes.rb i read
MyApp::Application.routes.draw do
resources :news
get "home/index"
- Rails 3.2.3
- Ruby 1.9.3p125
- MySQL 5.5
- Windows 7 64 bit
Rakes routes:
news_index GET /news(.:format) news#index
POST /news(.:format) news#create
new_news GET /news/new(.:format) news#new
edit_news GET /news/:id/edit(.:format) news#edit
news GET /news/:id(.:format) news#show
PUT /news/:id(.:format) news#update
DELETE /news/:id(.:format) news#destroy
home_index GET /home/index(.:format) home#index
root / home#index
Thanks in advance and sorry for my English