寻找action出错
有一个表叫news,
index页面有如下一行代码生成链接
<%= link_to 'new', new_news_path %>
点击这个代码生成的链接(http://localhost:3000/news/new),发生如下错误,看样子是去找到了show这个action。
Processing NewsController#new (for 127.0.0.1 at 2010-04-29 20:47:23) [GET] [4;36;1mNews Columns (15.6ms)[0m [0;1mSHOW FIELDS FROM `news`[0mRendering template within layouts/newsRendering news/newActionView::TemplateError (news_url failed to generate from [color=#FF0000]{:controller=>"news", :action=>"show"}[/color] - you may have ambiguous routes, or you may need to supply additional parameters for this route. content_url has the following required parameters: ["news", :id] - are they all satisfied?) on line #3 of app/views/news/new.html.erb:1: <h1>New news</h1>2: 3: <% form_for(@news) do |f| %>4: <%= f.error_messages %>5: 6: <p> (eval):16:in `news_path' app/views/news/new.html.erb:3 app/controllers/news_controller.rb:30:in `new'Rendered rescues/_trace (109.2ms)Rendered rescues/_request_and_response (0.0ms)Rendering rescues/layout (internal_server_error)