# Confusing action and id in link\_to\_remote

**URL:** <https://www.ruby-forum.com/t/confusing-action-and-id-in-link-to-remote/181348>\
**Category:** Rails\
**Created:** [January 10, 2010, 12:19pm UTC](https://www.ruby-forum.com/t/confusing-action-and-id-in-link-to-remote/181348 "2010-01-10T12:19:11Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![jeb](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/7ab992/32.png) [@jeb](https://www.ruby-forum.com/u/jeb)\
**Post date:** [January 10, 2010, 12:19pm UTC](https://www.ruby-forum.com/t/confusing-action-and-id-in-link-to-remote/181348/1 "2010-01-10T12:19:11Z")

</div>

I have a problem I have seen on several posts here but nowhere have I  
found a solution. If I call the action edit in a link\_to\_remote call,  
id and action are confused. If I instead call edit2 as action it works  
fine. I find that strange!

The call:  
\<%= link\_to\_remote index\_tablerow.full\_name, :url =\> { :controller =\>  
‘horses’, :action =\> ‘edit’, :id =\> index\_tablerow.id } %\>

results in (authenticity\_token removed):  
Parameters: {“action”=\>“6”, “id”=\>“edit”, “controller”=\>“horses”,  
“\_”=\>""}  
ActionController::UnknownAction (No action responded to 6. Actions:  
create, destroy, edit, edit2, index, new, show, and update):

But the call:  
\<%= link\_to\_remote index\_tablerow.full\_name, :url =\> { :controller =\>  
‘horses’, :action =\> ‘edit2’, :id =\> index\_tablerow.id } %\>

results in:  
Processing HorsesController#edit2 (for 127.0.0.1 at 2010-01-10  
12:13:30) [POST]  
Parameters: {“action”=\>“edit2”, “id”=\>“6”, “controller”=\>“horses”,  
“\_”=\>""}

My routs:  
map.connect ‘:controller/:action/:id’  
map.connect ‘:controller/:action/:id.:format’
