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.

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:

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

Chris

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> 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.

CM> Chris


Best regards,
Ralph mailto:[email protected]

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:

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

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs