link_to 帮手很奇怪 url
link_to helper weird url
大家好,我想知道如何摆脱在我的网站上单击 link 时生成的这个难看的 url。它看起来像这样:
http://www.imaaroncs.com/about?as=AboutMe&class=changeMe&controler=welcome
我只想说一下,但我不知道如何使用 link_to rails 帮助程序做到这一点,这是我目前所拥有的:
<li class="navbar-brand"><%= link_to "About Me", class: "changeMe",controler: "welcome", as: "AboutMe", action: "about"%>
尝试使用文字散列:
<%= link_to "About Me", {class: "changeMe", controller: "welcome", as: "AboutMe", action: "about"} %>
PS。此外,控制器中有双 l
。你有一个。
您发送了一些不需要的参数(? 之后的参数被解释为额外的查询参数)
<%= link_to "About Me", action: "about" %>
大家好,我想知道如何摆脱在我的网站上单击 link 时生成的这个难看的 url。它看起来像这样:
http://www.imaaroncs.com/about?as=AboutMe&class=changeMe&controler=welcome
我只想说一下,但我不知道如何使用 link_to rails 帮助程序做到这一点,这是我目前所拥有的:
<li class="navbar-brand"><%= link_to "About Me", class: "changeMe",controler: "welcome", as: "AboutMe", action: "about"%>
尝试使用文字散列:
<%= link_to "About Me", {class: "changeMe", controller: "welcome", as: "AboutMe", action: "about"} %>
PS。此外,控制器中有双 l
。你有一个。
您发送了一些不需要的参数(? 之后的参数被解释为额外的查询参数)
<%= link_to "About Me", action: "about" %>