We Recommend

The Rails Way The Rails Way
Now, for the first time, there’s a comprehensive, authoritative guide to building production-quality software with Rails. Pioneering Rails developer Obie Fernandez and a team of experts illuminate the entire Rails API, along with the Ruby idioms, design approaches, libraries, and plug-ins that make Rails so valuable.


Posted By

winson on 04/30/07


Tagged

textmate controller search ferret


Versions (?)


My search book with acts as ferret


Published in: Rails 


  1. def search
  2. # Book.rebuild_index
  3. @page_title = 'Search books'
  4. return unless request.post?
  5. @books = Book.find_by_contents(params[:q]) if params[:q]
  6. # flash.now[:notice] = 'No results.' unless @books.size > 0
  7. end

Report this snippet 

You need to login to post a comment.