Exercise 6.4


#1

In the app/views/destinations/show.html.erb I need to display the image, name and description.

I have <% @destination.each do |destination| %>
<%= image_tag destination.image %>
<%= destination.name %>
<%= destination.description %>
<% end %>

But have also tried several other code blocks and had no luck. Please advise


#2

Should this be, @destinations, (plural)?


#3

I just tried and that didn't work. I am pretty sure it's suppose to be singular because right before this step I did 6.3

Then in the Destinations controller, set up the show action. Use params to find a destination by id, and save it in @destination


#4

I'm not advisor but i'll try help you.

You don't need loop there. remove <% @destination.each do |destionation| %>

and add "@" before other staff, @destination.image, @destination.name and @destination.description.


#5

Thank you. I had to remove the <% end %> part as well.


#7

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.