7/9 Link to edit page works, isn't accepted


#1

I have a fully functioning link to the edit page for each destination, but it isn't accepted so I can't continue :confused:

        <%= image_tag @destination.image %>
        <h2><%= @destination.name %></h2>
        <p><%= @destination.description %></p>
        <p><%= link_to 'Edit', edit_destination_path(@destination) %></p>

#2

Hi Kamran,

Your code looks fine to me, so I'm not sure why you're not being passed :slight_frown:

Could you try refreshing the page, and if that doesn't work, posting the link to the exercise here?


#3

Not OP but I'm having the same issue and have tried the solutions you've outlined. I've even restarted the exercise.

Here's the exercise


#4

@tbayya What's the error message you're getting?


#5

@zystvan I'm being asked whether I added the edit link (which I have, the same way @kamran3210 has)


#6

@tbayya This is what I have, and it worked fine:

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

Do you have this in your config/routes.rb file?

get '/destinations/:id/edit' => 'destinations#edit', as: :edit_destination

#7

I did have the get statement (copied from the sidebar) in my code but when I pasted your snippets it was accepted. I don't know what went wrong, but thanks for your help!


#8

@tbayya No problem, maybe it was the double versus single quotes around Edit? That shouldn't be it, but it's the only difference I see :confused:


#11

This topic is inactive.