Adding Hash parameter in the URL Rails Routes

后端 未结 2 1133
忘掉有多难
忘掉有多难 2020-12-13 16:51

How to add a hash parameter in link_to. I need to generate a URL something like this..

/p/generate/#sometext

This is how my code looks now.

2条回答
  •  醉酒成梦
    2020-12-13 17:19

    I recognize this is an old post, but I thought I would contribute my recent discovery:

    <%= link_to "New Person", polymorphic_path([:new, person], anchor: "profile") %>
    

    See the API Docs for details.

提交回复
热议问题