<%= link_to 'Testing', wak_path %>
*This requires a routes: match 'wak', :to => 'home#wak'
他們是否把這個出來的軌道3.0或發生了什麼?Ruby on Rails 3.0爲什麼這兩個輸出兩個不同的東西?
<%= link_to 'Testing, :controller=>:home,:actions=>:wak %>
但在視圖中,我得到兩個不同的代碼,頂部的方法工作,雖然第二種方法沒有相同的行爲。爲什麼是這樣?
我只是做了一些測試,這就是我改變參數時所提出的。和我得到的輸出。
<%= 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&url[actions]=test&remote=true">hello</a>
它仍然沒有產生應該預期的。我已經印上了我所得到的。 – RoR 2010-09-17 23:03:52