-2

For some reason, I can not see the link. I can see the <h3> tag around it on the browser but no link to be found. There is no error, and I double-checked that the contact path exists. What am I doing wrong?

<h1>Hello to the my app</h1>
<h3><% link_to 'test', ask_path %></h3>
ToTheMoon
  • 79
  • 6

2 Answers2

1
<% link_to 'test', ask_path %>

move to

<%= link_to 'test', ask_path %>

you need <%= to show something on the page, not just execute ruby

Ursus
  • 29,643
  • 3
  • 33
  • 50
0

The link_to needs to be rendered, for that reason it is not being displayed then you are missing the = which makes it render.

See How do I wrap link_to around some html ruby code?

and

link_to Api reference

damuz91
  • 1,461
  • 2
  • 21
  • 37