# Where is the anchor?

**URL:** <https://www.ruby-forum.com/t/where-is-the-anchor/206440>\
**Category:** Rails\
**Created:** [May 1, 2011, 2:37pm UTC](https://www.ruby-forum.com/t/where-is-the-anchor/206440 "2011-05-01T14:37:26Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![luislavena](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/l/0ea827/32.png) [@luislavena](https://www.ruby-forum.com/u/luislavena)\
**Post date:** [May 1, 2011, 2:37pm UTC](https://www.ruby-forum.com/t/where-is-the-anchor/206440/1 "2011-05-01T14:37:26Z")

</div>

It has to be simple … but I can’t find it.

Where in the _controller_ does the anchor show up?

If the link\_to is to xyz#abc …

I end up at the right dispatch function

def xyz

# I get here

end

But I cannot find where to find abc.

---

<div class="post-metadata">

**Author:** ![ralphshnelvar](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/e19adc/32.png) [@ralphshnelvar](https://www.ruby-forum.com/u/ralphshnelvar)\
**Post date:** [May 1, 2011, 2:54pm UTC](https://www.ruby-forum.com/t/where-is-the-anchor/206440/2 "2011-05-01T14:54:07Z")

</div>

On 1 May 2011, at 13:37, Ralph S. wrote:

> def xyz
> 
> # I get here
> 
> end
> 
> But I cannot find where to find abc.

That part of the URL (the fragment identifier) doesn’t get sent to the  
server; it is processed locally in the browser after the document has  
been received from the server:

> **[URI fragment](https://en.wikipedia.org/wiki/Fragment_identifier#Processing)**
>
> In computer hypertext, a URI fragment is a string of characters that refers to a resource that is subordinate to another, primary resource. The primary resource is identified by a Uniform Resource Identifier (URI), and the fragment identifier points to the subordinate resource. The fragment identifier introduced by a hash mark # is the optional last part of a URL for a document. It is typically used to identify a portion of that document. The generic syntax is specified in RFC 3986. The hash mar...

Chris

---

<div class="post-metadata">

**Author:** ![ralphshnelvar](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/e19adc/32.png) [@ralphshnelvar](https://www.ruby-forum.com/u/ralphshnelvar)\
**Post date:** [May 1, 2011, 4:49pm UTC](https://www.ruby-forum.com/t/where-is-the-anchor/206440/3 "2011-05-01T16:49:36Z")

</div>

Chris,

Sunday, May 1, 2011, 6:52:39 AM, you wrote:

CM\> On 1 May 2011, at 13:37, Ralph S. wrote:

> > def xyz
> > 
> > # I get here
> > 
> > end
> > 
> > But I cannot find where to find abc.

CM\> That part of the URL (the fragment identifier) doesn’t get sent to  
the server; it is processed locally in the browser after the document  
has been received from the server:

CM\> [URI fragment - Wikipedia](http://en.wikipedia.org/wiki/Fragment_identifier#Processing)

Wow.

Frankly, I don’t understand it.

When you sent me the link to  
“[URI fragment - Wikipedia](http://en.wikipedia.org/wiki/Fragment_identifier#Processing)” could you  
explain what happened? That is … what was sent to the server and what  
ther server sent back to  
the browser?

This really confuses me.

And, yes, I realize this is now not a Rails question … but I’d be  
grateful for help.

CM\> Chris

–  
Best regards,  
Ralph [mailto:removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)

---

<div class="post-metadata">

**Author:** ![ralphshnelvar](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/e19adc/32.png) [@ralphshnelvar](https://www.ruby-forum.com/u/ralphshnelvar)\
**Post date:** [May 1, 2011, 4:54pm UTC](https://www.ruby-forum.com/t/where-is-the-anchor/206440/4 "2011-05-01T16:54:33Z")

</div>

On 1 May 2011, at 15:48, Ralph S. wrote:

> > >
> 
> This really confuses me.
> 
> And, yes, I realize this is now not a Rails question … but I’d be grateful for  
> help.

Don’t worry, it is a bit confusing.

When you ask your browser to fetch the URL:

[URI fragment - Wikipedia](http://en.wikipedia.org/wiki/Fragment_identifier#Processing)

the browser sends an HTTP request to the server at ‘[en.wikipedia.org](http://en.wikipedia.org)’  
for the resource ‘/wiki/Fragment\_identifier’.

The server sends back a document (in this case, an HTML document).

Your browser then uses the fragment identifier ‘Processing’ to  
automatically scroll you to the element in the document that has an ID  
of ‘Processing’.

In other words, the fragment identifier is a way to specify in a URL a  
particular element (or ‘fragment’, hence the name) within the document  
that is returned. However, the server just returns the whole document;  
the server doesn’t know about the fragment identifier.

Chris
