title: nested edit path not working
body: <p>Trying to figure out the edit path within <code>_comment.html.erb</code> file. </p>
  
  <p>Keep getting this error: </p>
  
  <pre><code>ActiveRecord::RecordNotFound in CommentsController#edit
  Couldn't find Article with 'id'=#&lt;Comment::ActiveRecord_Associations_CollectionProxy:0x007fcac37359e8&gt;
  </code></pre>
  
  <p>Don't know how to figure how to write the correct path.</p>
  
  <p><strong>Comments Controller</strong> </p>
  
  <pre><code>class CommentsController &lt; ApplicationController
    def create
      @article = Article.find(params[:article_id])
      @comment = @article.comments.create(comment_params)
      redirect_to article_path(@article)
    end
  
    def show
      @article = Article.find(params[:article_id])
      @comment = @article.comments.find(params[:id])
    end
  
    def edit 
      @article = Article.find(params[:article_id])
      @comment = @article.comments.find(params[:id])
    end
  
  
    def destroy 
      @article = Article.find(params[:article_id])
      @comment = @article.comments.find(params[:id])
      @comment.destroy 
      redirect_to article_path(@article) 
    end
  
    private
      def comment_params
        params.require(:comment).permit(:commenter, :body)
      end
  end
  </code></pre>
  
  <p><strong>_comment.html.erb</strong></p>
  
  <pre><code>&lt;p&gt;
    &lt;strong&gt;Commenter:&lt;/strong&gt;
    &lt;%= comment.commenter %&gt;
  &lt;/p&gt;
  
  &lt;p&gt;
    &lt;strong&gt;Comment:&lt;/strong&gt;
    &lt;%= comment.body %&gt;
  &lt;/p&gt;
  
  &lt;p&gt;
    &lt;%= link_to 'Edit', edit_article_comment_path(@article.comments, comment) %&gt;
  &lt;/p&gt;
  
  &lt;p&gt;
    &lt;%= link_to 'Show', [comment.article, comment] %&gt;
  &lt;/p&gt;
  
  &lt;p&gt;
    &lt;%= link_to 'Destroy Comment', [comment.article, comment],
                 method: :delete,
                 data: { confirm: 'Are you sure?' } %&gt;
  &lt;/p&gt;
  </code></pre>
  
  <p><strong>routes</strong></p>
  
  <pre><code>  resources :articles do 
      resources :comments
    end
  </code></pre>
  
  <p>How do I write the correct path?</p>
  
  <p>Also, the earlier path I had was this: </p>
  
  <pre><code>  &lt;%= link_to 'Edit', edit_article_comment_path(@article, comment) %&gt;
  </code></pre>
  
  <p>But it would turn up a blank edit form, ie, none of the text boxes had anything filled in ... hence why I tried the other path. </p>
  
  <p>Any help would be appreciated.</p>
  
  <p>Thank you.</p>
  
  <p><strong>Comment _form.html.erb</strong> </p>
  
  <pre><code>&lt;%= form_for([@article, @article.comments.build]) do |f| %&gt;
    &lt;p&gt;
      &lt;%= f.label :commenter %&gt;&lt;br&gt;
      &lt;%= f.text_field :commenter %&gt;
    &lt;/p&gt;
    &lt;p&gt;
      &lt;%= f.label :body %&gt;&lt;br&gt;
      &lt;%= f.text_area :body %&gt;
    &lt;/p&gt;
    &lt;p&gt;
      &lt;%= f.submit %&gt;
    &lt;/p&gt;
  &lt;% end %&gt;
  </code></pre>
  
  <p><strong>Article show.html.erb</strong></p>
  
  <pre><code>&lt;p&gt;
    &lt;strong&gt;Title:&lt;/strong&gt;
    &lt;%= @article.title %&gt;
  &lt;/p&gt;
  
  &lt;p&gt;
    &lt;strong&gt;Text:&lt;/strong&gt;
    &lt;%= @article.text %&gt;
  &lt;/p&gt;
  
  &lt;h2&gt;Comments&lt;/h2&gt;
  &lt;%= render @article.comments %&gt;
  
  &lt;h2&gt;Add a comment:&lt;/h2&gt;
  &lt;%= render 'comments/form' %&gt;
  
  &lt;%= link_to 'Edit', edit_article_path(@article) %&gt; |
  &lt;%= link_to 'Back', articles_path %&gt;
  </code></pre>