Exercise 6.4

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

Should this be, @destinations, (plural)?

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

1 Like

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.

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

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