Sortable list search

Hi I think I have a simple problem, but I just can't find the solution I just found a very simple sorting solution in a book something like that It works in the first page with localhost/faculdade?sort_by=name but when u try to go to the next page it goes to http://localhost:3000/faculdade?page=2 I know it should be /page=2&sort_by=name but don't know how to do it ..... Thanks in advance !

#on list.rhtml

<table border="1" cellpadding="5" cellspacing="1">   <tr>   <th> <a href="?sort_by=nome">Name </a> </th>

<%= link_to 'Next page', { :page => @faculdade_pages.current.next } if @faculdade_pages.current.next %>

and on the controller   def list     sort_by = params[:sort_by]     @_pages, @faculdades = paginate :faculdades, :order => sort_by, :per_page => 20

This should do the job. <%= link_to 'Next page', { :page => @faculdade_pages.current.next, :sort_by => params[:sort_by] } if @faculdade_pages.current.next %>

Richard Luther wrote:

This should do the job. <%= link_to 'Next page', { :page => @faculdade_pages.current.next, :sort_by => params[:sort_by] } if @faculdade_pages.current.next %>

On Apr 1, 12:39 pm, Adriano Lul <rails-mailing-l...@andreas-s.net>

problem solved, hopes it helps someone ...