"6. Show a destination" seems to be stuck


#1

I can't get past step 6.
https://www.codecademy.com/en/courses/learn-rails/lessons/one-many/exercises/one-many-show-destination
Even if I click Get Code it doesn't work. I think this might be a bug - did anybody else get past this?


#2

Normally, you're supposed to provide some arguments to this type of helper something_path, destination_path(destination) did work for me.


#3

You have to add <%= link_to "See more", destination_path %> to show.html.erb, that is in tags folder, not in destinations.


#4

OMG, that was it! So frustrating that it was because I can't read :wink:

(I did try all different ways of calling the path helper function, but in the wrong file...)

Thank you!


#5

I put this line
<%= link_to "See more", destination_path %>
in tags/show.html.erb and I see the buttons are there and work.

But the codeacademy do not let me proceed to the next step.

could someone help, please?


#6

Try specifying the variable, like this

<%= link_to "See more", destination_path(d) %>

#7

it works!! thanks!!

though I don't understand it because I use |destination| instead of |d|. :smiley:
d refers to |d| in <%= @destinations.each do |d| %>, doesn't it?

this is my code.
<%= @destinations.each do |destination| %>


<%= image_tag destination.image %>

<%= destination.name %>


<%= destination.description %>


<%= link_to "See more", destination_path(d) %>

#8

I made changes to the code, but the application is not accepted. how to solve this?


#9

@gersonneto

I think you need this line to iterate each destination.
<%= @destinations.each do |destination| %>

try to put that line under " Your code here "


#10

you have to add "See more" in:
app/views/tags/show.html.erb
not in
app/views/destinations/show.html.erb

    **<p><%= link_to "See more", destination_path(d) %></p>**

#11

After several attempts worked, thank you all.


#13

This topic is solved.