带有 URL 哈希的 Rails 路由(window.location.hash) [英] Rails routing with the URL hash (window.location.hash)

查看:41
本文介绍了带有 URL 哈希的 Rails 路由(window.location.hash)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有没有办法在 routes.rb 或控制器中获取 URL 的哈希值(例如/posts/show#35 中的35")?

Is there a way to grab the URL's hash value (e.g. the "35" in /posts/show#35) in routes.rb, or in a controller?

我的印象是这永远不会发送到服务器,但我只是想确定一下.

I'm under the impression that this is never sent to the server, but I just wanted to be sure.

谢谢!

汤姆

推荐答案

不,这不会发送到服务器.

No, this is not sent to the server.

这篇关于带有 URL 哈希的 Rails 路由(window.location.hash)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆