开发者

Ruby on Rails 3 link_to - Why do I get different html links?

<%= link_to 'Testing', wak_path %>

*This requires a routes: match 'wak', :to => 'home#wak'

Did they take this out of rails 3.0 or what is going on?

<%= link_to 'Testing, :controller=>:home,:actions=>:wak %>

But in the views, I'm getting two different code, the top method works, though the second method dosen't have the same behavior. Why is this?

I just did some test and this is what i've come up with when i change the params. and what i get for output.

<%= link_to 'hello', test_path, :remote=>true%>
<a href="/test" data-remote="true">hello</a> 

<%= link_to 'hello', {:controller=>:home,:actions=>:test}, :remote=>true%>
<a href="/home/index?actions=test" data-remote="true">hello</a> 


<%= link_to 'hello', :url=开发者_运维百科>{:controller=>:home,:actions=>:test}, :remote=>true%>
<a href="/home/index?url[controller]=home&amp;url[actions]=test&amp;remote=true">hello</a>


use :action instead of :actions, which is incorrect

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜