I want to create an active link

i want to display an active link on the restaurant the show, not sure if i use the <a ref? or the link_to ? any advice at the moment i have this <td><%= link_to restaurant.website %></td> which creates a link but does not go anywhere

Posted about 5 years ago by neil
Posted about 5 years ago by Alex Yang

Try using this instead: <td><%= link_to restaurant.website, restaurant.website %></td>

The reason why it wasn't working is because you're missing one of the parameters for 'link_to'. The syntax is 'link_to LINK_TEXT, LINK_ROUTE', where you need to put the link_text and link_route that you need. In your code, you're missing the LINK_ROUTE, which is why the link appears ok but isn't functional.

0
Posted about 5 years ago by neil

cheers thanks

0