If I do a
link_to ‘XYZ’, ‘/usage/Faq.html#GB_limit’
in my view …
can I detect “GB_Limit” in my controller? Where?
I know I can do
link_to ‘XYZ’, ‘/usage/Faq.html?bookmark=GB_limit’
and I can find GB_limit in params[:bookmark].
If I do a
link_to ‘XYZ’, ‘/usage/Faq.html#GB_limit’
in my view …
can I detect “GB_Limit” in my controller? Where?
I know I can do
link_to ‘XYZ’, ‘/usage/Faq.html?bookmark=GB_limit’
and I can find GB_limit in params[:bookmark].
Ralph S. wrote in post #969900:
If I do a
link_to ‘XYZ’, ‘/usage/Faq.html#GB_limit’
in my view …can I detect “GB_Limit” in my controller?
Not to my knowledge. I believe – and I hope someone will correct me if
I’m wrong – that the browser removes the #fragment section of the URL,
and merely does a HTTP GET ‘/usage/Faq.html’, so that the server never
even sees the #fragment. Therefore, the only way I’m aware of to
process the #fragment is to use client-side JavaScript.
(BTW, you should really be using lowercase for your HTML filenames, or
else you’re likely to run into case sensitivity issues.)
Where?
I know I can do
link_to ‘XYZ’, ‘/usage/Faq.html?bookmark=GB_limit’
and I can find GB_limit in params[:bookmark].
Right. The ?query=string is meant for the server. The #fragment is
meant for the client. That’s just how HTTP URLs work.
Marnen Laibow-Koser
http://www.marnen.org
[email protected]
On Tue, Dec 21, 2010 at 3:53 PM, Marnen Laibow-Koser
[email protected] wrote:
(BTW, you should really be using lowercase for your HTML filenames, or
else you’re likely to run into case sensitivity issues.)
I used to think that too, but then I tested it a few months back and
found every browser I tried worked fine with incorrect case in a URL.
http://example.com/Home.html worked when the actual URL was
http://example.com/home.html
I still go all lowercase just out of habit… looks cleaner too.
–
Greg D.
destiney.com | gregdonald.com
Thanks, Ivan Povalyukhin
Greg D. wrote in post #969911:
On Tue, Dec 21, 2010 at 3:53 PM, Marnen Laibow-Koser
[email protected] wrote:(BTW, you should really be using lowercase for your HTML filenames, or
else you’re likely to run into case sensitivity issues.)I used to think that too, but then I tested it a few months back and
found every browser I tried worked fine with incorrect case in a URL.http://example.com/Home.html worked when the actual URL was
http://example.com/home.htmlI still go all lowercase just out of habit… looks cleaner too.
AFAIK this is server-dependent, not browser-dependent – that is, some
servers are case-sensitive and some are not.
For example, my website is hosted on a case-sensitive server (Apache on
some sort of *nix). I just tried typing in
http://www.marnen.org/Music.html and got an error (Firefox 3.6, Mac OS X
10.6). marnen.org: Homepage of Marnen Laibow-Koser , however, gives the expected
page. Do you get different results? If so, in what browser?
It’s best to always treat your server (and browser) as if they’re
case-sensitive.
–
Greg D.
destiney.com | gregdonald.com
Marnen Laibow-Koser
http://www.marnen.org
[email protected]
This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.
Sponsor our Newsletter | Privacy Policy | Terms of Service | Remote Ruby Jobs