title: Multiple conditionals without repeating
body: <p>Wondering if there is a cleaner method of doing a conditional when a variable can equal 4, 6 or 8 without repeating previous inputs?</p>
  
  <p>For example.</p>
  
  <pre><code>&lt;%= form_with(model: sale, local: true) do |f| %&gt;
   &lt;% if @sale.cost == 4 %&gt;
     &lt;%= f.text_field :sale_1 %&gt;
     &lt;%= f.text_field :sale_2 %&gt;
     &lt;%= f.text_field :sale_3 %&gt;
     &lt;%= f.text_field :sale_4 %&gt;
   &lt;% elsif @sale.cost == 6 %&gt;
     &lt;%= f.text_field :sale_1 %&gt;
     &lt;%= f.text_field :sale_2 %&gt;
     &lt;%= f.text_field :sale_3 %&gt;
     &lt;%= f.text_field :sale_4 %&gt;
     &lt;%= f.text_field :sale_5 %&gt;
     &lt;%= f.text_field :sale_6 %&gt;
   &lt;% elsif @sale.cost == 8 %&gt;
     &lt;%= f.text_field :sale_1 %&gt;
     &lt;%= f.text_field :sale_2 %&gt;
     &lt;%= f.text_field :sale_3 %&gt;
     &lt;%= f.text_field :sale_4 %&gt;
     &lt;%= f.text_field :sale_5 %&gt;
     &lt;%= f.text_field :sale_6 %&gt;
     &lt;%= f.text_field :sale_7 %&gt;
     &lt;%= f.text_field :sale_8 %&gt;
   &lt;% end %&gt;
  &lt;% end %&gt;
  </code></pre>
  
  <p>So the above is repeating the previous inputs (i.e.. <code>&lt;%= f.text_field :sale_1 %&gt;</code>, <code>&lt;%= f.text_field :sale_2 %&gt;</code>) for each statement. Is there a way to state that if <code>@sale.cost == 6</code> then add on the two required inputs following the previous 4? For example:</p>
  
  <pre><code>&lt;%= form_with(model: sale, local: true) do |f| %&gt;
    &lt;% if @sale.cost == 4 %&gt;
      &lt;%= f.text_field :sale_1 %&gt;
      &lt;%= f.text_field :sale_2 %&gt;
      &lt;%= f.text_field :sale_3 %&gt;
      &lt;%= f.text_field :sale_4 %&gt;
    &lt;% some statement @sale.cost == 6 %&gt;
      &lt;%= f.text_field :sale_5 %&gt;
      &lt;%= f.text_field :sale_6 %&gt;
    &lt;% some statement @sale.cost == 8 %&gt;
      &lt;%= f.text_field :sale_7 %&gt;
      &lt;%= f.text_field :sale_8 %&gt;
  &lt;% end %&gt;
  </code></pre>