7. Update a Destination I - Step 6


#1

I'm having some difficulty with this one. I've looked at the same code on the first exercise and adapted it to the current one, and it still doesn't work. I'm completely new to programing, being Ruby on Rails my first trial ever (I know html and some css ).

Below is my code. Could anyone please check what I'm doing wrong?

div class="destination">
div class="container">
div class="row">
div class="col-xs-12">
<%= image_tag @destination.image %>
<%= @destination.name %>
<%= @destination.description%>
/div>
/div>
<%= link_to "Edit", "/destinations/:id/edit_destination" %>
/div>
/div>

Thank you in advance!


#2

Hi Rodmichelini

See if you can't find edit_destination_path() mentioned anywhere in the lesson - that's what the exercise is expecting you to use.

If you can't find it though, here's a hint on how that should look :wink:

Hint

edit_destination_path takes in a parameter, the destination to edit. So, you would do this:

<%= link_to "Edit", edit_destination_path(@destination) %>

Then, the edit_destination_path helper (which is provided automatically by Ruby on Rails) will magically generate the correct link to the “Edit” page for your destination! :sparkles: :tophat:


#3

Worked like a charm!

In fact that edit_destination_path was mentioned on the exercise, but it wasn't clear, since all I knew by that time was what I had already done on the past exercise. There wasn't a syntax information to the use of edit_destination_path().

So, thank you very much for your help!


#4

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