link_to
Generates an HTML <a> tag.
Parameters
str{String}: The link text. This parameter is required.url{String}: The URL. This parameter is required.[attribute]{Object}: Attributes supported by the<a>tag.returns{String}: The HTML string.
Usage
{{ link_to str url [attribute] }}
Example
{{{ link_to 'Shopline' 'https://www.shopline.com' }}}
HTML Attributes
You can define HTML attributes by including a parameter corresponding to the attribute name along with the desired value.
{{{ link_to 'Shopline' 'https://www.shopline.com' title='A link to Shopline' class='link-class' }}}
Was this article helpful to you?