lundi 14 septembre 2015

Image_tag First Image

boys,

Carrierwave use, I would like to show the first picture of a publication.

Try the following:

 <% @autos.each do |auto| %>

       <tr class="list">

         <td><%= image_tag auto.fotos.first.to_s , size: "50x50" %></td>
         <td><%= auto.ciudad %></td>
         <td><%= auto.marca %></td>
         <td><%= auto.modelo %></td>
         <td><%= auto.version %></td>
         <td><%= auto.año %></td>
         <td><%= auto.hp %></td>
         <td><%= auto.km %></td>
         <td><%= link_to 'Show', auto %></td>
         <td><%= link_to 'Edit', edit_auto_path(auto) %></td>
         <td><%= link_to 'Destroy', auto, method: :delete, data: { confirm: 'Are?' }%></td>

       </tr>

     <% end %>

enter image description here

This makes it look like hexadecimal, not illustrated.

Any ideas?

Aucun commentaire:

Enregistrer un commentaire