# How to handle '\<a name= ' links?

**URL:** <https://www.ruby-forum.com/t/how-to-handle-a-name-links/84377>\
**Category:** Rails\
**Created:** [February 3, 2007, 7:50pm UTC](https://www.ruby-forum.com/t/how-to-handle-a-name-links/84377 "2007-02-03T19:50:05Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![patcito](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/p/50afbb/32.png) [@patcito](https://www.ruby-forum.com/u/patcito)\
**Post date:** [February 3, 2007, 7:50pm UTC](https://www.ruby-forum.com/t/how-to-handle-a-name-links/84377/1 "2007-02-03T19:50:05Z")

</div>

hey all  
i have a item and im trying to do a link that way:

```
link_to 'item',:action=>'show',:id=>@item+'#item'

```

but i get %23item instead of the #item.

any idea whats wrong?

thanx in advance

Pat

---

<div class="post-metadata">

**Author:** ![patcito](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/p/50afbb/32.png) [@patcito](https://www.ruby-forum.com/u/patcito)\
**Post date:** [February 3, 2007, 8:13pm UTC](https://www.ruby-forum.com/t/how-to-handle-a-name-links/84377/2 "2007-02-03T20:13:09Z")

</div>

Hi Patrick,

Patrick A. wrote:

> link\_to ‘item’,:action=\>‘show’,:id=\>@item+’#item’
> 
> but i get %23item instead of the #item

Coupla thoughts…

1. Rails may need you to use braces to parse that correctly.  
e.g., link\_to ‘item’, {:action=\>‘show’,:id=\>@item+’#item’}

2. Rails may have trouble with ‘#’ as part of a symbol.

What’s the full string you’re getting back in params[:id] ? That might  
shed  
some light.

hth,  
Bill

---

<div class="post-metadata">

**Author:** ![patcito](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/p/50afbb/32.png) [@patcito](https://www.ruby-forum.com/u/patcito)\
**Post date:** [February 3, 2007, 8:17pm UTC](https://www.ruby-forum.com/t/how-to-handle-a-name-links/84377/3 "2007-02-03T20:17:09Z")

</div>

One more clue…

The ascii hex value for ‘#’ is 23

---

<div class="post-metadata">

**Author:** ![patcito](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/p/50afbb/32.png) [@patcito](https://www.ruby-forum.com/u/patcito)\
**Post date:** [February 3, 2007, 9:27pm UTC](https://www.ruby-forum.com/t/how-to-handle-a-name-links/84377/4 "2007-02-03T21:27:13Z")

</div>

thanx, i found it. anchor=\> does the job 🙂
