NameError in CompetitorsController#index

Posted by manish nautiyal on Stack Overflow See other posts from Stack Overflow or by manish nautiyal
Published on 2010-05-15T07:45:07Z Indexed on 2010/05/15 7:54 UTC
Read the original article Hit count: 223

Filed under:
|

Hi all

I am getting this problem when I run this code in server. In my localhost everything is running fine. But when I deploy my code in the server it shows me the error. I am using FERRET SERARCH IN MODEL.

NameError in CompetitorsController#index

uninitialized constant CompetitorsController::Competitor

/opt/ruby_enterprise/lib/ruby/gems/1.8/gems/activesupport-2.2.2/lib/active_support/dependencies.rb:102:in `const_missing'

/home/troche/mrecip_tool/releases/20091219131859/app/controllerscompetitors_controller .rb :19:in `index'

My controller is

class CompetitorsController < ApplicationController

include AuthenticatedSystem layout 'application'

auto_complete_for :proscribed, :competitor auto_complete_for :fee_earner, :fee_earner

protect_from_forgery :only => [:tag]

before_filter :login_required, :only => [:index, :show, :new, :edit]

@@total_company = 70

def index @compet = Competitor.find(:all) ### GETTING ERROR IN THIS LINE

respond_to do |format|
  format.html # index.html.erb
  format.xml  { render :xml => @compet }
end

end

def show @competitor = Competitor.find(params[:id])

respond_to do |format|
  format.html # show.html.erb
  format.xml  { render :xml => @competitor }
end

end

end


My Model is

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, :client, :subject_matter],:remote => true

end

© Stack Overflow or respective owner

Related posts about ruby-on-rails

Related posts about ruby