vimal
2008-Mar-24 02:37 UTC
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:in `build''
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.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Ruby on Rails: Talk" group.
To post to this group, send email to
rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
To unsubscribe from this group, send email to
rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---
Ar Chron
2008-Mar-24 04:24 UTC
Re: NameError on accessing Active Record from the controller
What exactly is your Question? Another model in your application? From the looks of it, Rails doesn''t know what a Question is... -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Vimal Krishnan
2008-Mar-24 04:43 UTC
Re: NameError on accessing Active Record from the controller
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 <rails-mailing-list-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org> wrote:> > What exactly is your Question? Another model in your application? From > the looks of it, Rails doesn''t know what a Question is... > -- > Posted via http://www.ruby-forum.com/. > > > >--~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---