RoR course, Associations I, exercise 5. Show a tag


#1

hi, guys. Help me, please. Don't know what to do in the exerice 5:
5. Show a tag .

In paricular point 3 of the exercise:

"3.In app/views/tags/show.html.erb inside the

element, display a tag's title.

Then in

...
, iterate through each destination in the @destinations array and display its image, name, and description."

What do I have to do there?


#2

Here is my solution:

<h2><%= @tag.title %></h2>

<div class="cards row">

  <% @destinations.each do |d| %>
  <div class="card col-xs-4">
    <%= image_tag d.image %>
    <h2><%= d.name %></h2>
    <p><%= d.description %></p>
    <p><%= link_to "See more", destination_path(d) %></p>
  </div>
  <% end %>

...


#4

When I tried that code i got the erorror message
undefined method `destination_path' for #<#:0x00000005d5d388>

Please help


#5

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