# Link\_to\_remote Swaps :action and :id

**URL:** <https://www.ruby-forum.com/t/link-to-remote-swaps-action-and-id/118464>\
**Category:** Rails\
**Created:** [October 27, 2007, 8:37am UTC](https://www.ruby-forum.com/t/link-to-remote-swaps-action-and-id/118464 "2007-10-27T08:37:26Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![riles01](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/59ef9b/32.png) [@riles01](https://www.ruby-forum.com/u/riles01)\
**Post date:** [October 27, 2007, 8:37am UTC](https://www.ruby-forum.com/t/link-to-remote-swaps-action-and-id/118464/1 "2007-10-27T08:37:26Z")

</div>

I have the following partial that I’m trying to load with a  
link\_to\_remote call:

\<%= link\_to\_remote h(person.name), :url =\> contacts\_person\_path(person), :html =\> { :href =\> contacts\_person\_path(person) } %\>  
 \<%= link\_to h(person.company.name), contacts\_company\_path(person.company) %\>  
 \<%=h person.title %\> 

 \<%= link\_to\_remote 'Edit', :url =\> edit\_contacts\_person\_path(person), :html =\> { :href =\> edit\_contacts\_person\_path(person) } %\>  
 \<%= link\_to\_remote 'Delete', :url =\> contacts\_person\_path(person), :confirm =\> 'Okay to delete?', :method =\> 'delete', :html =\> { :href =\> contacts\_person\_path(person) } %\> 

However, whenever I try to go to either the ‘show’ action (the first  
link\_to\_remote) or the ‘edit’ action, the :action gets the person.id,  
and the :id gets the action. I can see this in the logs, but I have no  
idea how to fix it. I tried using both

```
:url => { :controller => "contacts/people", :action => "edit", :id

```

=\> person }

and

```
:url => { :controller => "contacts/people", :id => "edit", :action

```

=\> person }

but both give the same error as calling the path. Any help would be  
much appreciated. I’m using Rails 1.2.5.

---

<div class="post-metadata">

**Author:** ![riles01](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/59ef9b/32.png) [@riles01](https://www.ruby-forum.com/u/riles01)\
**Post date:** [October 27, 2007, 8:51am UTC](https://www.ruby-forum.com/t/link-to-remote-swaps-action-and-id/118464/2 "2007-10-27T08:51:28Z")

</div>

Nevermind… I found it. I forgot the :method =\> :get.
