NameError on accessing Active Record from the controller with Rails 2.0.2

I get following error on accessing ActiveRecord from the controller,

log\development.log

NameError (uninitialized constant ProductsController::Question):
c:/ruby/lib/ruby/gems/1.8/gems/activesupport-2.0.2/lib/
active_support/dependencies.rb:478:in const_missing' /app/controllers/products_controller.rb:14:inbuild’

ProductsController.rb

def build
@qs = Question.find(:all)
end

I could not find much information relevant to my scenario on
NameError, Please let me know, if someone have any idea on whats going
on.

Your help be greatly appreciated.

What exactly is your Question? Another model in your application? From
the looks of it, Rails doesn’t know what a Question is…

Thanks for the reply. It helps to figure out the issue.

It was the model generation mistake. I have generated with model name in
plural.

Thanks again.

On Sun, Mar 23, 2008 at 11:24 PM, Ar Chron
[email protected]

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs