6.5 "Did you add a link to the destination"


#1

Alright so I am also stuck on this one. Here's my code. I don't know what I am doing wrong tbh. Any help would be appreciated.

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

    <% end %>
  
  </div>
</div>


#2

Hi @au_contraire,

Your code looks fine to me. Could you post a link to the exercise you're on?

Also, does switching browsers help?


#3

Here's the link

I switched to chrome but nothing's changed


#4

@au_contraire Thanks, it looks to me like lines 27-35 in app/views/destinations/show.html.erb are copy/pasted from tags/show.html.erb. In this case though, since there's only one destination, your code in the view should use the singular variable you created in the controller file (@destination), and access properties like @destination.name instead of how you're doing it now.

Does that make sense?


#5

Okay so both of these images are from the app/views/destinations/show.html.erb and tags/show.html.erb

Image 1

image 2

The code worked, I passed the exercise.Is that supposed to happen?


#6

@au_contraire

I passed the exercise.Is that supposed to happen?

Eventually, yes :wink: Did you pass it with the code shown, with a loop through @destinations inside app/views/destinations/show.html.erb?


#7

Well I should've been more clear :laughing:
I meant that since the code as shown above is identical, so I am just wondering if they needed to be identical.


#8

I am Dan entering the coding world to build a web site. Learned Fortran bacck in Engineering but this is more intense. Im stuck on Link


#9

@au_contraire I don't believe they should be the same, but if it's passing you I guess it's OK?


@getdrf Please create a new topic with your code, a link to the exercise you're on, and the error message you're getting.


#10

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