title: How to do optional nested forms with form_for in rails 5
body: <p>I have the following form with nested attributes. Which is working correctly.</p>
  
  <p>However I want to make the points optional, meaning if you leave the summary field blank the form should still submit and create a debate without creating a point.</p>
  
  <p>I have other forms that create points which rely on validates_presense_of :summary so I would rather keep that attribute there.</p>
  
  <p>Is there some sort of rails form_for built in functionality that allows the nested form to be optional? (IE only if they fill out the fields)</p>
  
  <p>debate.rb</p>
  
  <pre><code>class Debate &lt; ApplicationRecord
    validates_presence_of :title
    accepts_nested_attributes_for :points
    has_many :points
  end
  </code></pre>
  
  <p>point.rb</p>
  
  <pre><code>class Point &lt; ApplicationRecord
    validates_presence_of :summary
    belongs_to :debate
  end
  </code></pre>
  
  <p>_form.html.erb</p>
  
  <pre><code>&lt;%= form_with(model: debate, local: true, class: "col-6") do |form| %&gt;
    &lt;%= form.text_field :title %&gt;
    &lt;%= form.fields_for :points do |point_form| %&gt;
      &lt;%= point_form.text_area :summary %&gt;
    &lt;% end %&gt;
    &lt;%= form.submit class: "btn btn-primary" %&gt;
  &lt;% end %&gt;
  </code></pre>