Forum: Ruby on Rails simple paging question

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
786aca6b4728622a57a2c34fb1c9f0cd?d=identicon&s=25 rbrant (Guest)
on 2005-12-04 18:42
(Received via mailing list)
I'm trying to page through records returned from a search:


donor controller:


  def search
    str = params[:donor][:search_string] + '%'
    @donor_pages, @donors = paginate :donors, :per_page => 5,
:conditions => ["last_name LIKE ?", str]
    render(:template => 'donor/list')
  end


in my main view:

<%= text_field 'donor', 'search_string' %>



I'm trying to reuse the exsting 'list' template, which works, but I'm
wondering how to persist the search string in order to be able to page
thru the results.  I mean, I can think of various ways to do it, but
am unclear what the Rails way is. Do I simply append the search string
to the link?

Thanks!
This topic is locked and can not be replied to.