ruby-on-rails - Ruby on Rails 获取 # 参数

标签 ruby-on-rails request

如果我在查询字符串中得到#test,但我似乎找不到它,我会尝试在后端执行某些操作。

有人知道如何获取这些变量吗?

示例网址

loocalhost:3000/#test

谢谢

最佳答案

这称为 fragment identifier .

来自http://www.w3.org/Addressing/URL/uri-spec.html

A reference to a particular part of a document may, including the fragment identifier, look like

http://www.myu.edu/org/admin/people#andy

in which case the string "#andy" is not sent to the server, but is retained by the client and used when the whole object had been retrieved.

关于ruby-on-rails - Ruby on Rails 获取 # 参数,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/15533766/

相关文章:

ruby-on-rails - rails 从 url 中删除 Controller 路径

ruby-on-rails - 加载 View 后的 Rails 运行方法

ruby-on-rails - 如何将图像存储在我的 heroku postgres 数据库中

ruby-on-rails - Mongoid中的两个1-N关系(Rails)

javascript - 从请求 header 获取特定的cookie(express)

node.js - 在 Node 进程退出时发送http请求

javascript - 无法获取查询字符串数据

ruby-on-rails - rails xml 到事件记录对象

python - 尝试使用 kairos 上传文件时出错

api - Google map 网站和 API : different results