Rails - HighVoltage gem - link with anchor

左心房为你撑大大i 提交于 2020-03-26 15:29:48

问题


I have a problem with HighVoltage when I try to link to anchor on the static page. In the URL I am receiving '%23' instead of '#'.

Example

  <%= link_to 'xxx', page_path('xxx#yyy') %>

gives in the URL:

  http://localhost:3000/pages/xxx%23yyy

Can somebody give ma a hint how it can be solved, as I did not find any related information in the gem documentation.


回答1:


You must need to and the param anchor, for example:

link_to "About", page_path('index', anchor: "about")



来源:https://stackoverflow.com/questions/33025694/rails-highvoltage-gem-link-with-anchor

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!