views:

41

answers:

3
<%= 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>
+1  A: 

In the 2nd method you forgot to close the quote of Testing. It should be

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

In rails 3 it works fine the second method, you can also check the routes by writing in the command line rake routes and check each route helper method matches with the controller - action.

JohnDel
It is still not producing what should be expected. I've printed above what i'm getting.
RoR
A: 

Missing quote after Testing?

Kevin
I wish that was the reason.
RoR
A: 

:action instead of :actions

RoR