title: how can we create a nested form a single parent model in rails 4?
body: <p>I have a <code>model</code> called <code>timesheet</code>. i wanted to have a nested form for this <code>timesheet</code> model. means i do not want to add any child <code>models</code> to it. Basically i want to have nested form for single <code>model(timesheet)</code>. 
  when i click <code>add</code> <code>button</code> another <code>form</code> should come to the parent <code>model(timesheet)</code> similarly when we click <code>remove</code> the <code>form</code> should be removed. how can i do this? is there any <code>gem</code> to do this ?</p>
  
  <p>i am using the self referential association. </p>
  
  <p>getting the error:<code>Invalid association. Make sure that accepts_nested_attributes_for is used for :log_times association.</code></p>
  
  <pre><code>&lt;%= nested_form_for(@log_time, html: {:class =&gt; 'form-inline'}) do |f| %&gt;
      &lt;%= f.label :date %&gt;
      &lt;%= f.date_select :date, { order: [:day, :month, :year] } ,{:class =&gt; 'form-control' } %&gt;
      &lt;%= f.fields_for :log_time do |details| %&gt;
        &lt;%= details.label :date %&gt;
        &lt;%= details.date_select :date, { order: [:day, :month, :year] } ,{:class =&gt; 'form-control' } %&gt;
        &lt;%= details.link_to_remove "&lt;i class='fa fa-minus'&gt;&lt;/i&gt;Remove".html_safe,:class=&gt;"btn btn-danger btn-sm" ,:style=&gt;"color: white;"%&gt;
      &lt;%end %&gt;
      &lt;%= f.link_to_add "&lt;i class='fa fa-plus'&gt;&lt;/i&gt;Add".html_safe, :log_times, :class=&gt;"btn btn-primary btn-sm", :id=&gt;"",:style=&gt;"" %&gt;
      &lt;%= f.button "Submit" ,:class=&gt;"btn btn-primary  btn-sm" do%&gt;
        &lt;i class='fa fa-send-o'&gt;&lt;/i&gt;Submit
      &lt;%end%&gt;
  
  
  
  &lt;% end %&gt;
  </code></pre>