I have the following models:

    class Book < ActiveRecord::Base
      acts_as_ferret
      belongs_to :author
    end

    class Author < ActiveRecord::Base
        has_many :books
    end

and in the controller:

  def search
    if params[:query]
      @query = params[:query]
      @total, @books = Book.full_text_search(@query, :page => 
(params[:page]||1))
      @pages = pages_for(@total)
    else
      @books = []
    end
  end

I can use the acts_as_ferret plugin to search for a book by title but it 
isn't picking up the authors through the association. So I can't do a 
search for books by author.

I've a feeling I've left some config out here. Can anyone help me out?


-- 
Posted via http://www.ruby-forum.com/.
_______________________________________________
Ferret-talk mailing list
Ferret-talk@rubyforge.org
http://rubyforge.org/mailman/listinfo/ferret-talk

Reply via email to