Thanks guys,

The above seems to work for me perfectly except when i add a new not it 
doesnt update the index. if i delete and rebuild the index it works 
fine. can some one stear me in the right direction please i am guesing i 
have to add some metod to the create function in my notes_controller to 
update the index ???

Thanks, Adam

my code in contacts_controller:
-------------------
class Contact < ActiveRecord::Base
  validates_presence_of :First_Name
  validates_presence_of :Last_Name
  has_many :notes, :as => :notable

  acts_as_ferret :store_class_name => true, :lazy => true, :remote => 
false, :fields =>
  {

          :First_Name => { :store => :no, :boost => 2 },
          :Last_Name => { :store => :no, :boost => 1 },
          :description => { :store => :yes, :boost => 0.5 },
          :agent_id => { :store => :no, :boost => 0 },
          :note_note => { :store => :yes, :boost => 0 }

  }

  def note_note

      @index = Array.new
      for note in self.notes
        @index << note.note
      end
      return @index.join(" ")

  end
-- 
Posted via http://www.ruby-forum.com/.
_______________________________________________
Ferret-talk mailing list
[email protected]
http://rubyforge.org/mailman/listinfo/ferret-talk

Reply via email to