Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>Are you uploading the image as a file to your rails app's directory, or into a database? Without knowing that or how your images are related to whatever data they are going with it's difficult to answer.</p> <p>It can get a bit tricky if you're storing the files themselves in the database, but if you're only storing the path to the image it should be as simple as using an image tag with the stored path as the src; in the rails app that I did where images featured somewhat prominently, we had something that was a little messy, but looked like this:</p> <pre><code>&lt;%= link_to "&lt;span&gt;fig." + (order+1).to_s + "&lt;/span&gt;" + image_tag(url_for(:controller =&gt; 'upload', :action =&gt; 'picture', :id =&gt; picture.id), :class =&gt; 'list-image'), {:controller =&gt; 'upload', :action =&gt; 'show', :id =&gt; picture.id}, :class=&gt;'head-image' %&gt; </code></pre> <p>inside a <code>pictures.each</code> block, where 'upload' was the controller which handled uploading and storing of images (we kept them in the database). The end result of that showed a picture scaled down (via css, we're naughty) that, when clicked, would take the user to the full-sized version of the picture (eventually we were going to do a pretty AJAX zoom/overlay, but never got that far).</p> <p>Hopefully this is somewhat helpful, it's been several months since I've played with RoR.</p> <p>EDIT: Ach, reading comprehension fail. I thought you were handling the uploading fine but were having trouble accessing the uploaded photos. I'm unfamiliar with Paperclip; we used <a href="http://github.com/technoweenie/attachment_fu" rel="nofollow noreferrer">Attachment_fu</a>, with a tutorial <a href="http://clarkware.com/cgi/blosxom/2007/02/24#FileUploadFu&amp;gt" rel="nofollow noreferrer">here</a> that made things pretty easy for us. (We actually used the instructions/tutorial in <a href="http://pragprog.com/titles/fr_rr/rails-recipes" rel="nofollow noreferrer">this book</a>, I believe, but they seem similar.)</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload