On Miércoles, 19 de Agosto de 2009 11:58:54 CCH escribió:
> Hi Sergio
>
> Can you point me to how to resolve this error :-
>
> NameError (uninitialized constant Customer):
> app/controllers/customers_controller.rb:3
> -e:2:in `load'
> -e:2
Your model should be named Customer instead of Customers to follow rails
conventions. If you don't want to rename your model, maybe you can fix it
adding a irregular inflection to config/initializers/inflections.rb:
inflect.irregular 'customers', 'customers'
>
> Background
>
> 1) rails 2.3.3 on Ubuntu 9.04
> 2) active_scaffold as installed via script/plugin install
> git://github.com/activescaffold/active_scaffold.git
>
> 3) class CustomersController < ApplicationController
> layout "application"
> active_scaffold #NameError (uninitialized constant
> Customer):right here
>
> end
>
> 4)class Customers < ActiveRecord::Base
> belongs_to :source
> belongs_to :location
>
> has_many :receivables
> has_many :disbursements
>
> validates_presence_of :customer, :message => "Empty Customer!"
> validates_uniqueness_of :customer, :case_sensitive =>
> true, :allow_nil => false, :message => "Already exists !"
> #
> def to_label
> "#{customer}"
> end
>
> end
>
>
> Any pointers would be helpful.
> BTW, the same code runs perfectly in rails 1.2
>
>
> CCH
> http://cch4rails.blogspot.com
>
--
Sergio Cambra .:: entreCables S.L. ::.
Mariana Pineda 23, 50.018 Zaragoza
T) 902 021 404 F) 976 52 98 07 E) [email protected]
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"ActiveScaffold : Ruby on Rails plugin" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/activescaffold?hl=en
-~----------~----~----~----~------~----~------~--~---