title: Rails: Form_for: No route matches {:action=>"show", :controller=>"posts"} missing required keys: [:id]
body: <p>I am completely new to RoR and was trying to build a simple blog, but already got stuck at the "Adding Post" function.</p>
  
  <p>The following Error Message pops up when I load <code>.../posts/new</code>:</p>
  
  <pre><code>No route matches {:action=&gt;"show", :controller=&gt;"posts"} missing required keys: [:id]
  </code></pre>
  
  <p>Here is what my posts controller looks like this:</p>
  
  <pre><code>class PostsController &lt; ApplicationController
  def index 
  end
  
  def new 
  end
  
  def create 
      render plain: params[:post].inspect
  end
  </code></pre>
  
  <p>end</p>
  
  <p>Here is what my <code>new.html.erb</code> looks like this: </p>
  
  <pre><code>&lt;h1&gt;Add Post&lt;/h1&gt;
  &lt;%= form_for :post, url: posts_path do |f| %&gt;
  &lt;p&gt;
      &lt;%= f.label :title %&gt;&lt;br&gt;
      &lt;%= f.text_field :title %&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>I had set posts as resource in my routes. The surprising thing is, that on my friend's laptop, the code works. </p>
  
  <p>I would be very happy about any advice, and apologize for the silly question. </p>