In Rails, a method that generates the a tag in HTML with the extension ".html.erb". One of the helper methods that you often use when developing with Rails.
<%= link_to 'Character to be displayed' ,Linked URL or path%>
It is also possible to put the value called from the column of the table in the place of the character to be displayed.
ex) post.name
, @ user.name
, etc.
<%= link_to @user.name + "Mr.", root_path %>
Let's say +" the character you want to add "
.
The entire range including "san" is the range of the mouse cursor that goes to the link destination.
Recommended Posts