link_to
<%= link_to "Click me", controller: "pages", action: "home" %>
Explanation:
<%=
: Embeds Ruby code in the view to evaluate and output the result.link_to
: A helper method in Ruby on Rails for creating links."Click me"
: The anchor text or content of the link that the user will see.controller: "pages"
: Specifies the controller to handle the request, in this case, the "pages" controller.action: "home"
: Specifies the action within the controller to be invoked, in this case, the "home" action.%>
: Closes the embedded Ruby code block.