On 1 May 2011, at 15:48, Ralph Shnelvar wrote:
> Chris,
>
> Sunday, May 1, 2011, 6:52:39 AM, you wrote:
>
> CM> On 1 May 2011, at 13:37, Ralph Shnelvar 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.
>
> 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.
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
--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
No comments:
Post a Comment