# Link\_to\_remote crossing controllers

**URL:** <https://www.ruby-forum.com/t/link-to-remote-crossing-controllers/131826>\
**Category:** Rails\
**Created:** [March 13, 2008, 5:11pm UTC](https://www.ruby-forum.com/t/link-to-remote-crossing-controllers/131826 "2008-03-13T17:11:03Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![zeeboo](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/z/ec9cab/32.png) [@zeeboo](https://www.ruby-forum.com/u/zeeboo)\
**Post date:** [March 13, 2008, 5:11pm UTC](https://www.ruby-forum.com/t/link-to-remote-crossing-controllers/131826/1 "2008-03-13T17:11:03Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![zeeboo](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/z/ec9cab/32.png) [@zeeboo](https://www.ruby-forum.com/u/zeeboo)\
**Post date:** [March 13, 2008, 5:20pm UTC](https://www.ruby-forum.com/t/link-to-remote-crossing-controllers/131826/2 "2008-03-13T17:20:55Z")

</div>

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?

---

<div class="post-metadata">

**Author:** ![zeeboo](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/z/ec9cab/32.png) [@zeeboo](https://www.ruby-forum.com/u/zeeboo)\
**Post date:** [March 13, 2008, 5:23pm UTC](https://www.ruby-forum.com/t/link-to-remote-crossing-controllers/131826/3 "2008-03-13T17:23:12Z")

</div>

> ```
> <%= 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?
