I donβt understand what is going on here. I want to put button_to in my (haml) view. If I do this:
 =button_to( "New", {:action => "new"}, {} ) 
The generated page has:
 <form action="/cached_input_files/new" class="button_to" method="post"> <div> <input type="submit" value="New" /> <input name="authenticity_token" type="hidden" value="..blah.." /> </div> </form> 
which is normal, but I need to contact another controller. But if I try to specify a controller:
 =button_to( "New", {:action => "new", :controller => "editor"}, {} ) 
I get:
 <form action="/assets?action=new&controller=editor" class="button_to" method="post"> <div> <input type="submit" value="New" /> ... 
I expected the action be "/editor/new" , and I have no idea why this is not the case and how to correctly specify the controller to which I want to go.
I am using Rails 3.2.1.
source share