[code] @projetos = Array.new
for permissao in @permissao
# @proj = Projeto.paginate :page => params[:page], :per_page => 10,
:order => "data_de_termino", :conditions => ["responsavel = ? or
responsavel_td = ? or coordenador = ? or id = ?", @usuario, @usuario, @usuario, permissao.projeto.id] @proj = Projeto.paginate :page => params[:page], :per_page => 10,
:order => "data_de_termino", :conditions => ["id = ?", permissao.projeto.id]
for proj in @proj @projetos << proj
end
end @projetos.sort! { |a,b| a.data_de_termino <=> b.data_de_termino }
[/code]
It lists @projetos just fine, but if i want to make a pagination of @projetos (to show 10 projetos per page)
How can i do that in this case?
'Cause @projetos will not be a Projeto.paginate, because @projetos
allready is a array with everything I need.
[code] @projetos = Array.new
for permissao in @permissao
# @proj = Projeto.paginate :page => params[:page], :per_page => 10,
:order => "data_de_termino", :conditions => ["responsavel = ? or
responsavel_td = ? or coordenador = ? or id = ?", @usuario, @usuario, @usuario, permissao.projeto.id] @proj = Projeto.paginate :page => params[:page], :per_page => 10,
:order => "data_de_termino", :conditions => ["id = ?",
permissao.projeto.id]
for proj in @proj
@projetos<< proj
end
end @projetos.sort! { |a,b| a.data_de_termino<=> b.data_de_termino }
[/code]
It lists @projetos just fine, but if i want to make a pagination of @projetos (to show 10 projetos per page)
How can i do that in this case?
'Cause @projetos will not be a Projeto.paginate, because @projetos
allready is a array with everything I need.