My search book with acts as ferret

/ Published in: Rails
Save to your folder(s)

Copy this code and paste it in your HTML
  1. def search
  2. # Book.rebuild_index
  3. @page_title = 'Search books'
  4. return unless
  5. @books = Book.find_by_contents(params[:q]) if params[:q]
  6. #[:notice] = 'No results.' unless @books.size > 0
  7. end

Report this snippet


RSS Icon Subscribe to comments

You need to login to post a comment.