title: Bootstrap Carousel in Rails
body: <p>I'm working a project that has several images inside of a folder.  I've got Bootstrap working on my project, and was attempting to work in a carousel using <a href="http://www.w3schools.com/bootstrap/bootstrap_carousel.asp" rel="noreferrer">this tutorial</a>.  It seems to be an ideal fit for my needs, but I'm having trouble mixing it into my Ruby view.  Here's what I've got so far:</p>
  
  <pre><code>&lt;div id="myCarousel" class="carousel slide" data-ride="carousel"&gt;
    &lt;!-- Indicators --&gt;
    &lt;ol class="carousel-indicators"&gt;
      &lt;% @patient.images.each do |image| %&gt;
      &lt;li data-target="#myCarousel" data-slide-to="0" class="active"&gt;&lt;/li&gt;
      &lt;% end %&gt;
    &lt;/ol&gt;
  
    &lt;!-- Wrapper for slides --&gt;
  
        &lt;div class="carousel-inner" role="listbox"&gt;
         &lt;div class="item active"&gt;
          &lt;% @patient.images.each do |image| %&gt;
          &lt;%= image_tag image.image_file.url %&gt;
          &lt;% end %&gt;
          &lt;/div&gt;
        &lt;/div&gt;
  
  
  &lt;!-- Left and right controls --&gt;
    &lt;a class="left carousel-control" href="#myCarousel" role="button" data-slide="prev"&gt;
      &lt;span class="glyphicon glyphicon-chevron-left" aria-hidden="true"&gt;&lt;/span&gt;
      &lt;span class="sr-only"&gt;Previous&lt;/span&gt;
    &lt;/a&gt;
    &lt;a class="right carousel-control" href="#myCarousel" role="button" data-slide="next"&gt;
      &lt;span class="glyphicon glyphicon-chevron-right" aria-hidden="true"&gt;&lt;/span&gt;
      &lt;span class="sr-only"&gt;Next&lt;/span&gt;
    &lt;/a&gt;
  &lt;/div&gt;
  &lt;/div&gt;
  </code></pre>
  
  <p>I think I've got a syntax/order issue where my divs and my image tags lie, but moving them around doesn't change anything.  What I'm trying to do is have a seperate slide for each image, but using the current code it seems to want to put all of the images in one slide.</p>