Note that there are some explanatory texts on larger screens.

plurals
  1. PORuby on Rails Image display
    primarykey
    data
    text
    <p>So I am trying to make a website where you can upload your images and view them. I am done with the upload part and partially with the show part but I can't get them to display together. I get unwanted spaces between the images. For example right now I am getting a row with 4 images and then the next row has 1 image only(I could not upload a screenshot because i dont have enough reputation points, Sorry). I have tried everything i know to fill the free space but did not succeed.My show view code is,</p> <pre><code>&lt;%= render 'nav' %&gt; &lt;div id = "jags_show"&gt; &lt;h1&gt;Your Jags &lt;/h1&gt; &lt;div id = "clear"&gt;&lt;/div&gt; &lt;hr /&gt; &lt;% if @jags.empty? %&gt; &lt;p&gt; NO JAGS UPLOADED YET &lt;p&gt; &lt;% else %&gt; &lt;% @jags.each do |j| %&gt; &lt;div id = "jags"&gt; &lt;p id = "jagimage"&gt;&lt;%= image_tag j.image_url(:thumb) %&gt;&lt;/p&gt; &lt;p id = "jagname"&gt; &lt;%= j.name %&gt; &lt;/p&gt; &lt;div class="actions"&gt; &lt;%= link_to "update", edit_jag_path(j) %&gt; | &lt;%= link_to "remove", j, :confirm =&gt; 'Are you sure?', :method =&gt; :delete %&gt; &lt;/div&gt; &lt;/div&gt; &lt;% end %&gt; &lt;% end %&gt; &lt;/div&gt; </code></pre> <p>My CSS is</p> <pre><code>#jags{ display: inline; float: left; padding: 10px; background-color: #222; border: 2px solid white; } #jagname{ position: relative; margin-left: 10px; font-family: Helvetica; color:#c1f706; font-size: 18px; text-align: center; } #jagimage img{ border: 1.5px solid white; } #jags_show{ background-image:url('background.jpg'); margin-left: 80px; margin-right: 40px; margin-top: 80px; } #jags_show h1{ padding-top: 80px; color: #434341; font-family: Pilgi; font-size: 35px; background-color: #f0f0f0; display:inline; position: absolute; margin-top:-100px; } #clear{ clear:both; } .actions a{ color: #b3b2b1; text-decoration: none; } .actions { text-align: center; padding: 0px; } </code></pre> <p>Any suggestion/advice would be appreciated. Thank you. Oh and I am using the CarrierWave Gem if that is of any help.</p> <p>So i got my code to run on jsfiddle and it looks fine there, which makes me think that the problem I am having is due to the different orientation of the images. Here is my jsfiddle link <a href="http://jsfiddle.net/cVvYE/embedded/result/" rel="nofollow">http://jsfiddle.net/cVvYE/embedded/result/</a></p>
    singulars
    1. This table or related slice is empty.
    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.
 

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