# How to? link\_to with a rel="tag"

**URL:** <https://www.ruby-forum.com/t/how-to-link-to-with-a-rel-tag/67473>\
**Category:** Rails\
**Created:** [September 4, 2006, 2:44pm UTC](https://www.ruby-forum.com/t/how-to-link-to-with-a-rel-tag/67473 "2006-09-04T14:44:19Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![casper\_the\_ghost](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/58956e/32.png) [@casper\_the\_ghost](https://www.ruby-forum.com/u/casper_the_ghost)\
**Post date:** [September 4, 2006, 2:44pm UTC](https://www.ruby-forum.com/t/how-to-link-to-with-a-rel-tag/67473/1 "2006-09-04T14:44:19Z")

</div>

i want my html output to look like this:

[link text](https://www.ruby-forum.com/path/to/page/)

how do i tell the link\_to method that i need: rel=“tag”?

thanks.

---

<div class="post-metadata">

**Author:** ![casper\_the\_ghost](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/58956e/32.png) [@casper\_the\_ghost](https://www.ruby-forum.com/u/casper_the_ghost)\
**Post date:** [September 4, 2006, 2:44pm UTC](https://www.ruby-forum.com/t/how-to-link-to-with-a-rel-tag/67473/2 "2006-09-04T14:44:19Z")

</div>

veganstraightedge@… \<veganstraightedge@…\> writes:

> i want my html output to look like this:
> 
> [link text](https://www.ruby-forum.com/path/to/page/)
> 
> how do i tell the link\_to method that i need: rel=“tag”?

From:

> **[ActionView::Helpers::UrlHelper](https://api.rubyonrails.org/classes/ActionView/Helpers/UrlHelper.html#M000378)**
>
> Provides a set of methods for making links and getting URLs that depend on the routing subsystem (see ActionDispatch::Routing).

- link\_to(name, options = {}, html\_options = nil,  
parameters\_for\_method\_reference)

html\_options in a Rails function generally means parameters which will  
be  
inserted into the HTML tag, so:

link\_to “link text”, “/path/to/page/”, {:rel =\> “tag”}

Gareth

---

<div class="post-metadata">

**Author:** ![casper\_the\_ghost](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/58956e/32.png) [@casper\_the\_ghost](https://www.ruby-forum.com/u/casper_the_ghost)\
**Post date:** [September 10, 2006, 3:37am UTC](https://www.ruby-forum.com/t/how-to-link-to-with-a-rel-tag/67473/3 "2006-09-10T03:37:58Z")

</div>

> veganstraightedge@… \<veganstraightedge@…\> writes:

> - link\_to(name, options = {}, html\_options = nil,  
> parameters\_for\_method\_reference)
> 
> html\_options in a Rails function generally means parameters which  
> will be  
> inserted into the HTML tag, so:
> 
> link\_to “link text”, “/path/to/page/”, {:rel =\> “tag”}

thanks gareth.

though that wasn’t quite right either. ryan davis gave me this fix on  
another list

link\_to(“link text”,  
{:controller =\> “controller\_name”, :action =\>  
“action\_name”, :id =\> “id\_value”},  
:rel =\> “tag”)

i’m just posting this for posterity. and in case someone else ever  
needs it.

thanks.  
shane
