title: Rails click on div to upload image
body: <pre><code>    &lt;div id="photo_attachment_container"&gt;
          &lt;%= f.file_field :photo %&gt;
      &lt;/div&gt;
  </code></pre>
  
  <p>Currently this is how my standard image upload button looks in rails. I would like to improve it aesthetically by having a div on the page with a background image as placeholder, and people can click on that div to upload an image (the function currently provided by the button) and when the image is uploaded it becomes the background of the div. </p>
  
  <p>Also paperclip handles the upload and can resize to the size of the div.</p>
  
  <p>How can I do something like this in rails? Thanks</p>
  
  <p><img src="https://i.stack.imgur.com/w6Li4.jpg" alt="enter image description here"></p>