Show a destination 6/4


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="" width="80">

<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> <%= %> </h2>
        <p> <%= dest.description %> </p>
        <%= link_to "See more", destination_path(d) %>
            <% end %>


sorry by the way here is the error its giving:

undefined method `each' for nil:NilClass


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.


thank you will do the changes and update soon


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