Got it.

I've found the problem.

I've trade

@proj = Projeto.paginate :page => params[:page], :per_page => 10, :order 
=> "data_de_termino", :conditions => ["id = ?", permissao.projeto.id]

for

@proj = Projeto.all(:order => "data_de_termino", :conditions => ["id = 
?", permissao.projeto.id])


I think that because of the first pagination, the second doesn't works.

But even that way, I've done (just to make sure that will works) the 
line:


 @projetos = Projeto.paginate :per_page => 1, :page => params[:page], 
:conditions => ["id in (?)", @projet.collect { |pro| pro.id } ], :order 
=> "data_de_termino"


This way, @projetos will be an Active Record object.




So, my final code is this way:


 @projet = Array.new
 for permissao in @permissao
    @proj = Projeto.all(:order => "data_de_termino", :conditions => ["id 
= ?", permissao.projeto.id])
      for proj in @proj
        @projet << proj
      end
 end
 @projetos = Projeto.paginate :per_page => 1, :page => params[:page], 
:conditions => ["id in (?)", @projet.collect { |pro| pro.id } ], :order 
=> "data_de_termino"
-- 
Posted via http://www.ruby-forum.com/.