如何转义 Rails redirect_to :anchor => “/ui-tabs-1”
我想要的是
redirect_to ... :anchor => "/ui-tabs-1" #=> http://....#/ui-tabs-1
我得到的是
redirect_to ... :anchor => "/ui-tabs-1" #=> http://....#%2Fui-tabs-1
我想在我的redirect_to(未转义)中包含正斜杠。
谢谢
What I want is
redirect_to ... :anchor => "/ui-tabs-1" #=> http://....#/ui-tabs-1
What I get is
redirect_to ... :anchor => "/ui-tabs-1" #=> http://....#%2Fui-tabs-1
I want to include the forward slash in my redirect_to (unescaped).
Thanks
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
我假设您想在 URL 重定向中包含正斜杠?
如果是,您可以unescape它,
否则从锚点中删除正斜杠即可使其工作
I assume you want to include the forward slash in your redirect to Url?
If yes, you can just unescape it
else removing the forward slash from anchor makes it work
尝试使用单引号
Try using single quotes