# Will\_paginate problem

**URL:** <https://www.ruby-forum.com/t/will-paginate-problem/168576>\
**Category:** Ruby\
**Created:** [May 22, 2009, 4:21pm UTC](https://www.ruby-forum.com/t/will-paginate-problem/168576 "2009-05-22T16:21:49Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![edounl](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/e/76d3ee/32.png) [@edounl](https://www.ruby-forum.com/u/edounl)\
**Post date:** [May 22, 2009, 4:21pm UTC](https://www.ruby-forum.com/t/will-paginate-problem/168576/1 "2009-05-22T16:21:49Z")

</div>

Hi,  
I have a problem using paginate: i made the paginate to work, but it  
only shows results in the first page, whenever i click on the second or  
others it doesnt show results, and i have more then 2 results for that  
search.

this is the code

controller:

def searchnome  
nome = params[:nome]  
@posts = Post.paginate(:all,:conditions =\> [“name=?”,  
“#{nome}”],:page =\> params[:page] ,:per\_page =\> 2 )  
end

view :

\<% @posts.each do |post| %\>

Name : \<%=h post.name %\>  
Title : \<%=h post.title %\>  
Content  
 \<%=h post.content %\>  
  
\<% end %\>  
\<%= will\_paginate @posts %\>

i am a bit new in ruby, any help is welcome 🙂
