title: Rails don't showing images from public folder
body: <p>I am making an app - it is uploading (with <code>carrierwave</code>) pdf and ppt files, then <code>Docsplit</code> extracts pages/slides to images and save it to <code>public/uploads/document/unique_timestamp/</code> folder.</p>
  
  <p>In <code>show</code> view the images don't show, but links are correct - for example "<a href="http://localhost:3000/Users/my_user_name/Documents/rp/1512/my_app/public/uploads/document/1450527696/qwerty_2.jpg" rel="nofollow noreferrer">http://localhost:3000/Users/my_user_name/Documents/rp/1512/my_app/public/uploads/document/1450527696/qwerty_2.jpg</a>" and I see <a href="https://i.stack.imgur.com/jMYfs.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/jMYfs.png" alt="enter image description here"></a></p>
  
  <p>What can I do?</p>
  
  <p>in controllers/documents_controller.rb:</p>
  
  <pre><code>def show
      @output_path = "#{Rails.root}/public/uploads/document/" + @document.image.to_s[-14,10] + "/"
  end
  </code></pre>
  
  <p>in view/show.html.erb:</p>
  
  <pre><code>&lt;ul&gt;
  &lt;% Dir.foreach(@output_path) do |f| %&gt;
  
    &lt;% if f != "." &amp;&amp; f != ".." %&gt;
      &lt;li&gt;
        &lt;%= image_tag @output_path + f %&gt;
        &lt;br&gt;&lt;%= f %&gt;
      &lt;/li&gt;
  
    &lt;% end %&gt;
  
  &lt;% end %&gt;
  &lt;/ul&gt;
  </code></pre>