Problems with link_to_remote

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?

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

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?

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

Help, please!!

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?

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

I found my problem. It was lacking this:

<%= javascript_include_tag “prototype” %>

Very thanks Fred. §:]