Forum: Ruby will_paginate problem

Announcement (2017-05-07): is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see and for other Rails- und Ruby-related community platforms.
Edou S. (Guest)
on 2009-05-22 18:21
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

this is the code


   def searchnome
   nome = params[:nome]
       @posts = Post.paginate(:all,:conditions => ["name=?",
"#{nome}"],:page => params[:page] ,:per_page => 2 )

view :

<% @posts.each  do |post| %>
    <td><a>Name : </a></td>
    <td><%=h %></td><br />
    <td><a>Title : </a></td>
    <td><%=h post.title %></td><br />
    <td><a>Content</a></td><br />
    <td><%=h post.content %></td><br />
  </tr><br />
<% end %>
<br />
<%= will_paginate @posts %>

i am a bit new in ruby, any help is welcome :)
This topic is locked and can not be replied to.