简体   繁体   中英

link_to helper weird url

Hello everyone I was wondering how I can get rid of this ugly url that was generated when I clicked a link on my website. It looks like this:

http://www.imaaroncs.com/about?as=AboutMe&class=changeMe&controler=welcome

I want it to just say about but I do not know how to do it with the link_to rails helper this is what I have so far:

<li class="navbar-brand"><%= link_to "About Me", class: "changeMe",controler: "welcome", as: "AboutMe", action: "about"%>

您正在发送一些不需要的参数(?之后的那些被解释为其他查询参数)

<%= link_to "About Me", action: "about" %>

Try using the literal hash:

<%= link_to "About Me", {class: "changeMe", controller: "welcome", as: "AboutMe", action: "about"} %>

PS. Also, there is double l in controller. You have one.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM