title: Couldn't find Post without an ID / ActiveRecord::RecordNotFound
body: <p>I know this is a very basic solution however, I am just not seeing it right now. I am getting a 'Couldn't find Post without an ID' error within CommentsController#create. </p>
  
  <p>I created a 'New Comment' button under the post which should then redirect to the comment form. From there once a user inputs their comments and clicks the 'Create Comment' button the comment should be displayed under the original post. Thank you in advance. </p>
  
  <p><strong>Comments Controller</strong></p>
  
  <pre><code>Class CommentsController &lt; ApplicationController
    before_filter :authenticate_user!
  
    def new
    @comment = Comment.new
    end
  
  
    def create
      @post = Post.find(params[:post_id])
      @comment = @post.comments.create(params[:comment].permit(:commenter, :body))
  
      respond_to do |format|
        if @comment.save
          format.html { redirect_to @post, notice: 'Comment was successfully created.' }
          format.json { render json: @comment, status: :created, location: @comment }
        else
          format.html { render action: "new" }
          format.json { render json: @comment.errors, status: :unprocessable_entity }
        end
      end
  
    end
  
  def destroy
      @post = Post.find(params[:post_id])
      @comment = @post.comments.find(params[:id])
      @comment.destroy
      redirect_to post_path(@post)
  end
  
  def show
    @comment = Comment.new
  end
  
  end
  </code></pre>
  
  <p><strong>Post/Show</strong></p>
  
  <pre><code>&lt;div class="row"&gt;
      &lt;div class="col-md-offset-4 col-med-8"&gt;
          &lt;div class="panel panel-default"&gt;
          &lt;div class="panel-heading center"&gt;
  
          &lt;% if @post.image.url %&gt;
              &lt;%= image_tag @post.image.url(:medium) %&gt;
  
          &lt;% elsif @post.video.url %&gt;
              &lt;%= video_tag @post.video.url(:medium), controls: true, type: "video/mp4" %&gt;
          &lt;% end %&gt;&lt;/br&gt;
  
  
          &lt;p&gt;
             &lt;strong&gt;Likes:&lt;/strong&gt;
             &lt;%= @post.get_likes.size%&gt;
          &lt;/p&gt;
  
  
          &lt;%=link_to image_tag('like.jpg', :border =&gt; 0), likes_post_path(@post) %&gt;    
          &lt;%=link_to image_tag('unlike.jpg', :border =&gt; 0), dislikes_post_path(@post) %&gt;
  
  
          &lt;/div&gt;
          &lt;div class="panel-body"&gt;
          &lt;p&gt;&lt;%= @post.description %&gt;&lt;/p&gt;
  
          &lt;% user = @post.user %&gt;
          &lt;p&gt;&lt;strong&gt;&lt;%= link_to(user.name, user_path(user)) if @post.user %&gt;&lt;/strong&gt;&lt;/p&gt;
  
          &lt;%= link_to 'New Comment', new_comment_path, class: "btn btn-danger btn-sm active" %&gt;&lt;/br&gt;
  
  
          &lt;br&gt;&lt;% if @post.user == current_user %&gt;
              &lt;%= link_to edit_post_path(@post) do %&gt;
              &lt;span class="glyphicon glyphicon-edit"&gt;&lt;/span&gt;
              Edit
            &lt;% end %&gt;
          &lt;% end %&gt;
          &lt;%= link_to 'Back', posts_path %&gt;
  
              &lt;/div&gt;
          &lt;/div&gt;
  &lt;/div&gt;
  </code></pre>
  
  <p><strong>Comments / _form</strong></p>
  
  <pre><code>&lt;%= form_for [@post, Comment.new] do |f| %&gt;
    &lt;% if @comment.errors.any? %&gt;
      &lt;div id="error_explanation"&gt;
        &lt;h2&gt;&lt;%= pluralize(@comment.errors.count, "error") %&gt; prohibited this comment from being saved:&lt;/h2&gt;
  
        &lt;ul&gt;
        &lt;% @comment.errors.full_messages.each do |msg| %&gt;
          &lt;li&gt;&lt;%= msg %&gt;&lt;/li&gt;
        &lt;% end %&gt;
        &lt;/ul&gt;
      &lt;/div&gt;
    &lt;% end %&gt;
  
  
    &lt;div class="field"&gt;
      &lt;%= f.label :body %&gt;&lt;br&gt;
      &lt;%= f.text_area :body %&gt;
    &lt;/div&gt;
    &lt;div class="actions"&gt;
      &lt;%= f.submit class: "btn btn-danger btn-sm" %&gt;
    &lt;/div&gt;
  &lt;% end %&gt;
  </code></pre>
  
  <p><strong>Routes</strong></p>
  
  <pre><code> resources :comments
   resources :posts do
      resources :comments
  end
  </code></pre>
  
  <p><strong>Comments / Show</strong></p>
  
  <pre><code>&lt;p id="notice"&gt;&lt;%= notice %&gt;&lt;/p&gt;
  
  &lt;p&gt;
    &lt;strong&gt;Post:&lt;/strong&gt;
    &lt;%= @comment.post_id %&gt;
  &lt;/p&gt;
  
  &lt;p&gt;
    &lt;strong&gt;Body:&lt;/strong&gt;
    &lt;%= @comment.body %&gt;
  &lt;/p&gt;
  
  &lt;%= link_to 'Edit', edit_comment_path(@comment) %&gt; |
  &lt;%= link_to 'Back', comments_path %&gt;
  </code></pre>
  
  <p><strong>Rake Routes</strong></p>
  
  <pre><code>post_comments GET     /posts/:post_id/comments(.:format)          comments#index
                           POST    /posts/:post_id/comments(.:format)          comments#create
          new_post_comment GET     /posts/:post_id/comments/new(.:format)      comments#new
         edit_post_comment GET     /posts/:post_id/comments/:id/edit(.:format) comments#edit
              post_comment GET     /posts/:post_id/comments/:id(.:format)      comments#show
  </code></pre>