Where is the anchor?

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.

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:

http://en.wikipedia.org/wiki/Fragment_identifier#Processing

Chris

Chris,

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

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.

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:

http://en.wikipedia.org/wiki/Fragment_identifier#Processing

Wow.

Frankly, I don't understand it.

When you sent me the link to "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.

Don't worry, it is a bit confusing.

When you ask your browser to fetch the URL:

  http://en.wikipedia.org/wiki/Fragment_identifier#Processing

the browser sends an HTTP request to the server at '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