Show a destination 6/4


#1

Here is what i have so far, but the thing is that not only am i struggling to understand what exactly they are asking. When i have looked up similar code its not that far off. I was able to pass the image tags section and changed the code to to destination but its still wrong and i don't want to cheat and have it pass the code because it gives you the entire lesson rather than just what you need help on

<div class="header">
  <div class="container">
    <img src="http://s3.amazonaws.com/codecademy-content/courses/learn-rails/img/logo-1tm.svg" width="80">
    <h1>BokenjiKan</h1>
  </div>
</div>

<div class="destination">
  <div class="container">
    <div class="row">
      <div class="col-xs-12">

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

#2

sorry by the way here is the error its giving:

undefined method `each' for nil:NilClass


#3

Hi @migdotcom,

The error message seems to be saying you haven't created the @destinations variable yet. You'll need to make sure you create it inside your destinations_controller.rb file :slight_smile:

Also, inside your loop through @destinations, there is no dest variable since you're using d for the loop instead.


#4

thank you will do the changes and update soon


#5

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