Get anchor part of URL in controller in Ruby on Rails

Pioz picture Pioz · Nov 5, 2010 · Viewed 21.6k times · Source

Is there a way to get the anchor part of a URL in a controller?

Example: if I type http://www.foo.com/bar#anchor123 can I get the string anchor123 in my controller?

Answer

True Soft picture True Soft · Nov 5, 2010

You can't do that in Rails, because the anchor is not sent to the server. See mikeduncan.com/?s=named+anchors