> On Feb 10, 2016, at 10:34 PM, Alexis Marie <li...@ruby-forum.com> wrote:
> 
> Hey Walter. Thanks for all of the help!
> 
> I went through all of your steps. What should I write on my view page?
> 
> 
> 
> 

If you want to show all the images for a listing, the simplest thing is:

<%- @listing.images.each do |image| %>
<%= image_tag image.image_url %>
<%- end %>

Now there are lots of other refinements you could add to this -- sizing the 
images, extra HTML around each one, setting their order, etc. -- but this will 
get you started.

Walter


> 
> <div class="row">
>  <div class="col-md-6">
>    <div class="thumbnail">
>      <%= image_tag @listing.image.url %>
>    </div>
>  </div>
>  <div class="col-md-6">
>    <h3><%= @listing.name %></h3>
>    <p><%= number_to_currency(@listing.price) %></p>
>    <p><%= @listing.description %></p>
>    <br>
>    <div class="center">
>      <%= link_to "Buy It Now", new_listing_order_path(@listing), class: 
> "btn btn-primary", data: { no_turbolink: true } %>
>    </div>
>  </div>
> </div>
> 
> <% if current_user == @listing.user %>
>  <%= link_to 'Edit', edit_listing_path(@listing), class: "btn btn-link" 
> %> |
> <% end %>
> <%= link_to 'Back', listings_path, class: "btn btn-link" %>
> 
> Attachments:
> http://www.ruby-forum.com/attachment/11261/Screen_Shot_2016-02-10_at_7.32.27_PM.png
> 
> 
> -- 
> Posted via http://www.ruby-forum.com/.
> 
> -- 
> You received this message because you are subscribed to the Google Groups 
> "Ruby on Rails: Talk" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to rubyonrails-talk+unsubscr...@googlegroups.com.
> To post to this group, send email to rubyonrails-talk@googlegroups.com.
> To view this discussion on the web visit 
> https://groups.google.com/d/msgid/rubyonrails-talk/b247b538ee05afff0ec46b34daa6ad42%40ruby-forum.com.
> For more options, visit https://groups.google.com/d/optout.

-- 
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to rubyonrails-talk+unsubscr...@googlegroups.com.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/rubyonrails-talk/66ECC6EB-CA09-44ED-AD0C-4F582983136B%40wdstudio.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to