In an attempt to learn RoR, I''m porting a simple contact manager app I wrote in PHP/MySQL to RoR. I''ve gotten most of it to work and learned a lot along the way, but I simply cannot get the searching to work, and I''m sure I''m just making it harder than it really is. I sure could use a hand. I have a search page that has a text field and a pulldown box with the following options that coralate with the fields in the db: Table name == contacts Field names: firstName lastName email1 email2 phone1 phone2 street city state zip birthDay notes ...and displayed the results. So if I want a search page, what do I do? What do I put in my contacts_controller (def search ... I''m assuming), my search.rhtml? Do I need a results page too, or do they get posted in the same page? Do I have to add anything to a view, too? Many, many thanks!!! (I''m pulling my hair out!) -- 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-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Also, I don''t need anything too fancy like act_as_ferret or act_as_sol, just a simple MySQL LIKE search will work fine. Links to tutorials or examples would be great! Thanks -- 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-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
try using acts_as_ferret. you just need to index each field in your contacts model. Plan Alpha wrote:> In an attempt to learn RoR, I''m porting a simple contact manager app I > wrote in PHP/MySQL to RoR. I''ve gotten most of it to work and learned a > lot along the way, but I simply cannot get the searching to work, and > I''m sure I''m just making it harder than it really is. I sure could use a > hand. I have a search page that has a text field and a pulldown box with > the following options that coralate with the fields in the db: > > Table name == contacts > Field names: > > firstName > lastName > email1 > email2 > phone1 > phone2 > street > city > state > zip > birthDay > notes > > ...and displayed the results. > > So if I want a search page, what do I do? What do I put in my > contacts_controller (def search ... I''m assuming), > my search.rhtml? Do I need a results page too, or do they get posted in > the same page? Do I have to add anything > to a view, too? > > Many, many thanks!!! (I''m pulling my hair out!)-- 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-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---