title: Rendering a partial N times instead of for each item in an array
body: <p>I have a set of attributes that belong to a product, e.g. <code>:name</code>, <code>:smalls</code>, <code>:mediums</code>, <code>:larges</code>, <code>:price</code>, etc.</p>
  
  <p>Right <code>:smalls</code>, <code>:mediums</code>, and <code>:larges</code> are arrays of strings:</p>
  
  <pre><code>@products = [
    { :id =&gt; 1,
      :name     =&gt; 'Product 1',
      :description =&gt; 'description goes here',
      :smalls   =&gt; ['S'],
      :mediums  =&gt; ['M','M'],
      :larges   =&gt; ['L',],
      :price    =&gt; 50.0,
      :names_and_numbers =&gt; 'optional'
    }
  ]
  </code></pre>
  
  <p>The number of strings in each array determines the number of times the corresponding partial is rendered:</p>
  
  <pre><code>&lt;div id="small-field-set"&gt;
  &lt;% product[:smalls].each do |small| %&gt;
    &lt;%= render :partial =&gt; 'small', :locals =&gt; { :product =&gt; product, :small =&gt; small } %&gt;
  &lt;% end %&gt;
  &lt;/div&gt;
  
  &lt;div id="medium-field-set"&gt;
  &lt;% product[:mediums].each do |medium| %&gt;
    &lt;%= render :partial =&gt; 'medium', :locals =&gt; { :product =&gt; product, :medium =&gt; medium } %&gt;
  &lt;% end %&gt;
  &lt;/div&gt;
  
  &lt;div id="large-field-set"&gt;
  &lt;% product[:larges].each do |large| %&gt;
    &lt;%= render :partial =&gt; 'large', :locals =&gt; { :product =&gt; product, :large =&gt; large } %&gt;
  &lt;% end %&gt;
  &lt;/div&gt;
  </code></pre>
  
  <p>How can I have a number, rather than the size the array, determine how many times the partials is rendered?</p>
  
  <p>I tried doing this:</p>
  
  <pre><code>{ ...
    :smalls   =&gt; [1],
    :mediums  =&gt; [2],
    :larges   =&gt; [1],
    ...
  }
  </code></pre>
  
  <p>But that did not work.</p>