Link_to_remote crossing controllers

I have a link_to_remote call that calls on another controller.

The desired behavior is:

  1. user clicks on link
  2. remote call processed on controller
  3. link updated

Here’s my code:


<% if self.queryBook(item.get(‘asin’)) == 0 %>
<%= link_to_remote ‘Ning It!’, :update=>‘amazon’,
:url=>{:controller=>‘Books’, :action=>‘newAmazon’,
:title=>item.get(‘itemattributes/title’),
:url=>item.get(‘detailpageurl’),
:author=>item.get(‘itemattributes/author’),
:desc=>item.get(‘editorialreviews/editorialreview/
content’).to_s,
:asin=>item.get(‘asin’)
}%>
<% else %>
Ninged.
<% end %>

What I’m getting as the return on the webpage is:
Template is missing
Missing template books/newAmazon.html.erb in view path C:/Code/rails/
crazyKid/app/views

It’s almost as if the :url switch to the controller ‘Books’ is
overriding where I’m at.

zeeboo wrote:

  <%= link_to_remote 'Ning It!', :update=>'amazon',
    :url=>{:controller=>'Books', :action=>'newAmazon',

What I’m getting as the return on the webpage is:
Template is missing
Missing template books/newAmazon.html.erb in view path C:/Code/rails/
crazyKid/app/views

It looks like the books controller’s #newAmazon method is successfully
being called but doesn’t have a template to generate anything to return
in order to update the “amazon” element…

How is books_controller#newAmazon defined?

  <%= link_to_remote 'Ning It!', :update=>'amazon',
    :url=>{:controller=>'Books', :action=>'newAmazon',

Missing template books/newAmazon.html.erb in view path C:/Code/rails/
crazyKid/app/views

It’s almost as if the :url switch to the controller ‘Books’ is
overriding where I’m at.

sure, you tell the thing to call the action newAmazon in Books
what did you expect it to call?

by the way: i don’t see any tag with id=“amazon”. so how should it
update it?