title: Alternating rails image_uploader.rb generated <div class="one/other"> in app's .erb view?
body: <p>I have an image uploader that adds sample cover pictures to a containing row <code>&lt;div class=”row”&gt;</code>.  The images render in their own  tags with class=”rotation” like <code>&lt;div class=”rotation”&gt;</code>.  I need to also alternate that class between <code>“rotation”</code> and <code>“rotation-alt”</code> in order to apply alternating rotations with CSS.  How can I alternate which tag is rendered with each upload in a rails .erb view?</p>
  
  <p>The .erb currently looks like this:</p>
  
  <pre><code>  &lt;%= link_to "Upload New Photo", new_cover_path, class: "btn" %&gt;
  
    &lt;div class="row"&gt;
      &lt;% @covers.each do |cover| %&gt;
  
      &lt;div class="rotation"&gt;
          &lt;%= link_to image_tag(cover.photo.url(:thumb), :class =&gt; 'img-responsive'), image_path(cover.photo.url), :class =&gt; 'thumbnail' if cover.photo? %&gt;
      &lt;/div&gt;
  
      &lt;% end %&gt;
  </code></pre>
  
  <p>Thanks for any help.</p>