Whoa!  There's a lot to chew on there.
First off, thank you for the reply.
Let me chew, chew on this over the weekend and I'll let you know my
progress on Monday.
I've used wil_paginate before so that helps.
Thanks again.
John

Aldric Giacomoni wrote:
> Hang on to your shorts - I did something quite similar.
> It's very simple, I have two models, each are a table in a different 
> database, but when you get to Rails level, you don't care - it's just 
> two models.
> 
> On the main page, I have two divs: patient and searchresults
> Above the divs, I have a :
> form_remote_tag :update => "patient", :url => { :action => "search" }
> I use this to get a string (hint : text_field_tag is your friend)
> 
> My controller has, for the action "search", the following:
> 
>   def search
>     name = params[:search]
>     results = GMPatient.filter_by_name(name, params[:page])
> 
>     render :partial => 'shared/paginated_gm_patients',
>       :locals => {:patients => results}
>   end
> 
> What is "filter_by_name", you ask? Good question! I use the 
> will-paginate gem. My model has the following:
> 
>   def self.filter_by_name(search, page)
>     paginate :per_page => 20, :page => page,
>     :conditions => ['displayed_name like ?', "%#{search}%"],
>     :order => 'last ASC, first ASC'
>   end
> 
> The '%' sign is my wildcard. So, now that I have the results, how do I 
> display them?
> 
> It's your standard table, but here's the twist: I add a cell after the 
> data I display, and here's what's in the cell:
> <td><%= link_to_remote "Find matches", :update => "matches", :url => { 
> :controller => "comparison", :action => "find_matches", :id => 
...
-- 
Posted via http://www.ruby-forum.com/.

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Talk" group.
To post to this group, send email to rubyonrails-talk@googlegroups.com
To unsubscribe from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to