# Problems with link\_to\_remote

**URL:** <https://www.ruby-forum.com/t/problems-with-link-to-remote/77773>\
**Category:** Rails\
**Created:** [November 30, 2006, 2:01pm UTC](https://www.ruby-forum.com/t/problems-with-link-to-remote/77773 "2006-11-30T14:01:31Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![Mr\_Browstone](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/8e8cbc/32.png) [@Mr\_Browstone](https://www.ruby-forum.com/u/Mr_Browstone)\
**Post date:** [November 30, 2006, 2:01pm UTC](https://www.ruby-forum.com/t/problems-with-link-to-remote/77773/1 "2006-11-30T14:01:31Z")

</div>

Well, this is my action in contoller “usuario”:

…  
def acao  
render :action =\> “list”, :layout =\> false  
end  
…

and my view “empresa/list”:

…  
\<%= link\_to\_remote (“Lista de Usuarios”,  
:update =\> “corpo” ,  
:url =\> {:controller =\> “usuario” ,:action =\>  
“acao”})%\>

 ...

But this not happening the effect, the list of “usuarios” this not  
appearing in the list of “empresas”. The code this correct, what this  
lacking?

---

<div class="post-metadata">

**Author:** ![Mr\_Browstone](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/8e8cbc/32.png) [@Mr\_Browstone](https://www.ruby-forum.com/u/Mr_Browstone)\
**Post date:** [November 30, 2006, 2:07pm UTC](https://www.ruby-forum.com/t/problems-with-link-to-remote/77773/2 "2006-11-30T14:07:25Z")

</div>

I’m guessing that you list view then iterates over some collection  
(either manually or with a partial) of objects. The problem is then that  
you have not setup that collection in your acao method.

Fred

---

<div class="post-metadata">

**Author:** ![Mr\_Browstone](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/8e8cbc/32.png) [@Mr\_Browstone](https://www.ruby-forum.com/u/Mr_Browstone)\
**Post date:** [November 30, 2006, 2:17pm UTC](https://www.ruby-forum.com/t/problems-with-link-to-remote/77773/3 "2006-11-30T14:17:59Z")

</div>

Frederick C. wrote:

> I’m guessing that you list view then iterates over some collection  
> (either manually or with a partial) of objects. The problem is then that  
> you have not setup that collection in your acao method.
> 
> Fred

this is method list:  
…  
def list  
@usuario\_pages, @usuarios = paginate :usuarios, :per\_page =\> 10  
end  
…

Well, I am using RadRails and MySQL. If not will bother you, I can send  
the project for you e-mail. Ok?

---

<div class="post-metadata">

**Author:** ![Mr\_Browstone](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/8e8cbc/32.png) [@Mr\_Browstone](https://www.ruby-forum.com/u/Mr_Browstone)\
**Post date:** [November 30, 2006, 3:56pm UTC](https://www.ruby-forum.com/t/problems-with-link-to-remote/77773/4 "2006-11-30T15:56:25Z")

</div>

The list method isn’t called when you call render :action =\> ‘list’  
It just makes rails use the list.rhtml template.  
If you want the list method to be called you must do that yourself.

Fred

---

<div class="post-metadata">

**Author:** ![Mr\_Browstone](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/8e8cbc/32.png) [@Mr\_Browstone](https://www.ruby-forum.com/u/Mr_Browstone)\
**Post date:** [November 30, 2006, 2:57pm UTC](https://www.ruby-forum.com/t/problems-with-link-to-remote/77773/5 "2006-11-30T14:57:28Z")

</div>

Help, please!!

---

<div class="post-metadata">

**Author:** ![Mr\_Browstone](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/8e8cbc/32.png) [@Mr\_Browstone](https://www.ruby-forum.com/u/Mr_Browstone)\
**Post date:** [November 30, 2006, 5:02pm UTC](https://www.ruby-forum.com/t/problems-with-link-to-remote/77773/6 "2006-11-30T17:02:35Z")

</div>

Frederick C. wrote:

> The list method isn’t called when you call render :action =\> ‘list’  
> It just makes rails use the list.rhtml template.  
> If you want the list method to be called you must do that yourself.
> 
> Fred

What?

---

<div class="post-metadata">

**Author:** ![Mr\_Browstone](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/8e8cbc/32.png) [@Mr\_Browstone](https://www.ruby-forum.com/u/Mr_Browstone)\
**Post date:** [November 30, 2006, 8:34pm UTC](https://www.ruby-forum.com/t/problems-with-link-to-remote/77773/7 "2006-11-30T20:34:30Z")

</div>

Ah yes, not including prototype doesn;t help.  
What is was saying is that  
render :action =\> “list”, :layout =\> false  
just renders the list template. It doesn’t call the list method

Fred

---

<div class="post-metadata">

**Author:** ![Mr\_Browstone](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/8e8cbc/32.png) [@Mr\_Browstone](https://www.ruby-forum.com/u/Mr_Browstone)\
**Post date:** [November 30, 2006, 5:27pm UTC](https://www.ruby-forum.com/t/problems-with-link-to-remote/77773/8 "2006-11-30T17:27:14Z")

</div>

I found my problem. It was lacking this:

\<%= javascript\_include\_tag “prototype” %\>

Very thanks Fred. Â§:]
