title: How to use simple form for comments from a nested resource?
body: <p>So I'm creating a blog rails app and I'm trying to create a comment session on the blog. I'm trying to render a form using simple form, but I'm having a hard time getting the simple form to work. For now I have:</p>
  
  <pre><code>&lt;%= simple_form_for ([@user, @post.comments.build]) do |f| %&gt;
    &lt;%= f.input :comment %&gt;
    &lt;%= f.button :submit %&gt;
  &lt;% end %&gt;
  </code></pre>
  
  <p>but it says that post.comments isn't a defined path.</p>
  
  <p>My comment model:</p>
  
  <pre><code>class Comment &lt; ActiveRecord::Base
    belongs_to :post
    belongs_to :user
  end
  </code></pre>
  
  <p>post belongs to user and has_many comments
  user has many post and has many comments</p>
  
  <p>Here are my current routes:</p>
  
  <pre><code>  resources :posts do
      resources :comments 
    end
  </code></pre>
  
  <p>Any advice?
  Thanks!</p>