would you help about const_missing error...

Hello.

I have made a model name is User, so have created "users" table. and I made Customer class inhrtied by User Class.

When I call the Customer class in some controller, the controller passed error msg to me.

It seems that controller doesn't find table("users") when make Customer instance.

previously, thanks for your help.

error message -----------------------------

NameError in MemberController#signup uninitialized constant MemberController::Customer

RAILS_ROOT: C:/Documents and Settings/Administrator/My Documents/ Aptana Studio/pseudo

c:/ruby/lib/ruby/gems/1.8/gems/activesupport-2.1.1/lib/active_support/ dependencies.rb:493:in `const_missing' app/controllers/ member_controller.rb:9:in `signup'-e:2:in `load'-e:2

here is pieces of controller and model code

----------------------- controller -------------------------------- class MemberController < ApplicationController

  def signup     if request.post?       @member = Customer.new(params[:user])       if @member.save

      end     end   end

-------------------------- model ------------------------------------ class User < ActiveRecord::Base

end

class Customer < User   def initailize     self.type = 'Customer'   end end

class Manager < Employee   def initailize     self.type = 'Manager'   end

Hello.

I have made a model name is User, so have created "users" table. and I made Customer class inhrtied by User Class.

When I call the Customer class in some controller, the controller passed error msg to me.

It seems that controller doesn't find table("users") when make Customer instance.

No, it's not finding your customer class because it's not in customer.rb. Either put Customer in customer.rb or require user with require_dependency

ALso you don't need that initializer to set the type column (rails will do that for you). It's also not how initialize is spelled. Fred