title: No method error in rails 3 app
body: <p>I'm getting this error:</p>
  
  <pre><code>undefined method `post_comments_path' for #&lt;#&lt;Class:0x1052a6e98&gt;:0x1052a4be8&gt;
  Extracted source (around line #27):
  
  24: 
  25: &lt;% end%&gt;
  26: 
  27: &lt;% form_for [@post, Comment.new] do |f| %&gt;
  28:   &lt;p&gt;
  29: 
  30:     &lt;%= f.label :name, "Author" %&gt;&lt;br /&gt;
  </code></pre>
  
  <p>My routes:</p>
  
  <pre><code>Myblog::Application.routes.draw do
  
    root      :to =&gt; 'posts#index'
  
    resources :comments
  
    resources :posts, :has_many =&gt; :comments
  </code></pre>
  
  <p>post.rb</p>
  
  <pre><code>class Post &lt; ActiveRecord::Base
    has_many :comments
  end
  </code></pre>
  
  <p>comment.rb</p>
  
  <pre><code>class Comment &lt; ActiveRecord::Base
    belongs_to :post
  end
  </code></pre>
  
  <p>views/posts/show.html.erb</p>
  
  <pre><code>&lt;p id="notice"&gt;&lt;%= notice %&gt;&lt;/p&gt;
  
  &lt;p&gt;
    &lt;b&gt;Title:&lt;/b&gt;
    &lt;%= @post.title %&gt;
  &lt;/p&gt;
  
  &lt;p&gt;
    &lt;b&gt;Body:&lt;/b&gt;
    &lt;%= @post.body %&gt;
  &lt;/p&gt;
  
  &lt;h2&gt;Comments&lt;/h2&gt;
  
  &lt;% @post.comments.each do |c|%&gt;
  
      &lt;p&gt;
          &lt;b&gt;&lt;%=h c.name %&gt;said: &lt;/b&gt;
          &lt;%= time_ago_in_words(c.created_at)%&gt; ago       
      &lt;/p&gt;
      &lt;p&gt;
          &lt;%= c.body%&gt;
      &lt;/p&gt;
  
  &lt;% end%&gt;
  
  &lt;% form_for [@post, Comment.new] do |f| %&gt;
    &lt;p&gt;
  
      &lt;%= f.label :name, "Author" %&gt;&lt;br /&gt;
      &lt;%= f.text_field :name %&gt;&lt;br /&gt;
      &lt;%= f.label :body, "Comment Description" %&gt;&lt;br /&gt;
      &lt;%= f.text_area :body %&gt;
    &lt;/p&gt;
  
    &lt;p&gt;
      &lt;%= f.submit "Add Comment" %&gt;
    &lt;/p&gt;
  &lt;% end %&gt;
  
  
  &lt;%= link_to 'Edit', edit_post_path(@post) %&gt; |
  &lt;%= link_to 'Back', posts_path %&gt;
  </code></pre>
  
  <p>Confused as I don't see any reference to post_comments_path??</p>
  
  <p>rake routes:</p>
  
  <pre><code>root        /(.:format)                  {:action=&gt;"index", :controller=&gt;"posts"}
      comments GET    /comments(.:format)          {:action=&gt;"index", :controller=&gt;"comments"}
      comments POST   /comments(.:format)          {:action=&gt;"create", :controller=&gt;"comments"}
   new_comment GET    /comments/new(.:format)      {:action=&gt;"new", :controller=&gt;"comments"}
  edit_comment GET    /comments/:id/edit(.:format) {:action=&gt;"edit", :controller=&gt;"comments"}
       comment GET    /comments/:id(.:format)      {:action=&gt;"show", :controller=&gt;"comments"}
       comment PUT    /comments/:id(.:format)      {:action=&gt;"update", :controller=&gt;"comments"}
       comment DELETE /comments/:id(.:format)      {:action=&gt;"destroy", :controller=&gt;"comments"}
         posts GET    /posts(.:format)             {:action=&gt;"index", :controller=&gt;"posts"}
         posts POST   /posts(.:format)             {:action=&gt;"create", :controller=&gt;"posts"}
      new_post GET    /posts/new(.:format)         {:action=&gt;"new", :controller=&gt;"posts"}
     edit_post GET    /posts/:id/edit(.:format)    {:action=&gt;"edit", :controller=&gt;"posts"}
          post GET    /posts/:id(.:format)         {:action=&gt;"show", :controller=&gt;"posts"}
          post PUT    /posts/:id(.:format)         {:action=&gt;"update", :controller=&gt;"posts"}
          post DELETE /posts/:id(.:format)         {:action=&gt;"destroy", :controller=&gt;"posts"}
  </code></pre>