Create Messages 1, creating link with the New Message button

I am trying to get past the 7th step of adding:

<%= link_to 'New Message', 'messages/new' %>

to the /app/views/messages/index.html.erb file and I have done this, but it’s giving me an error telling me that it has not been done. Here is the error message:

Make sure to add the ‘link_to’ to app/views/messages/index.html.erb.

But that step is still showing up as red instead of green and I cannot progress. Nevertheless, the New Message button does function just fine and I’m able to add new messages.

It could be something as simple as not using the double quotes in the example. Minor, and petty, but these things do tend to happen in author written SCT’s. It’s a possibility.

1 Like

Thanks, yeah, I had tried both single quotes and double quotes and neither worked.

I figured it out by accident. I changed it to this:

<%= link_to 'New Message', "messages/new" %> 

and it worked. Combination of single quotes for the button text and double quotes to call up the new form.

1 Like

As I suspected. The author wrote only one pattern to follow and the SCT has no other option but to accept only that.

1 Like

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