title: How to add a specific item's image as a background image in rails
body: <p>This one is frustrating me. I'm using paperclip for the images, and adding them to the model <code>offer</code> That's fine. My problem is adding them in as a background image on the index page for <code>offer</code> So my code looks like this:</p>
  
  <pre><code>&lt;div class="product-image"&gt;&lt;/div&gt;
  &lt;style&gt;
  .product-image {
       width: 50%;
       height: 200px;
       margin-left: 25%;
       border-radius: 50%;
       background-image: url(&lt;%= image_tag offer.image %&gt;);
       background-size: cover;
       background-repeat: no-repeat;
       background-position: center;
  }
  &lt;/style&gt;
  </code></pre>
  
  <p>When I inspect it on chrome, the code looks like this: </p>
  
  <pre><code>background-image: url(&lt;img src="/system/offers/images/000/000/033/original/headphones.jpg?1468610654" alt="Headphones" /&gt;);
  </code></pre>
  
  <p>Anybody know a fix? Like I said, the images are working fine. If I simply put a line of code in as <code>&lt;%= image_tag offer.image %&gt;</code>, the image shows. Help is very much appreciated.</p>