I have the following partial that I'm trying to load with a link_to_remote call:
<div id="person_<%= person.id %>" class="item"> <div class="details"> <span class="name"><%= link_to_remote h(person.name), :url => contacts_person_path(person), :html => { :href => contacts_person_path(person) } %></span><br /> <%= link_to h(person.company.name), contacts_company_path(person.company) %><br /> <%=h person.title %> </div>
<div class="options"> <%= link_to_remote 'Edit', :url => edit_contacts_person_path(person), :html => { :href => edit_contacts_person_path(person) } %><br /> <%= link_to_remote 'Delete', :url => contacts_person_path(person), :confirm => 'Okay to delete?', :method => 'delete', :html => { :href => contacts_person_path(person) } %> </div> </div>
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.