views:

21

answers:

1

Hi all

I am getting this error when I am using

acts_as_ferret :fields =>[:competitor], :remote => true

NameError in PartController#index

uninitialized constant PartController::Competitor


My Model

class Competitor < ActiveRecord::Base

validates_presence_of :fee_earner_id, :notes

belongs_to :fee_earner belongs_to :country belongs_to :state belongs_to :user

acts_as_ferret :fields =>[:competitor], :remote => true

end


My controller

class PartController < ApplicationController

def index

@proscribeds = Competitor.paginate(:all, :order => sort , :page => params[:page], :per_page => 70 )

end

end


Its working fine in localhost but when I deploy it in the server than I get this error.

act_as_ferret is working good with other models. I don't know why this is not working with only Competitor model.

A: 

These might seem like simplistic suggestions, but here's what comes to mind:

  • Do you have the same OS on localhost and the server? I've been burned by little discrepancies like the differences between how Unix and Windows handle mixed case pathnames.
  • Have the most updated versions of all your files been moved? Can you do a diff and ensure that there isn't a missing config file or environment variable or something?

I know those suggestions aren't really Rail/Ruby-specific, but I've found that little configuration problems tend to give me more headaches than actual code errors do.

Good luck!

AaronM