yes, those are in "app/models/forum", it is working fine with Rails 2.3.11 On Thursday, March 7, 2013 3:12:33 PM UTC-8, Chris Schneider wrote:
> Are you putting those models in `app/models/project/forum/topic.rb` and > such? Rails assumes namespaces are subdirectories when trying to load up > classes. > > > On Thu, Mar 7, 2013 at 3:54 PM, Sonali Kapoor <onali...@gmail.com<javascript:> > > wrote: > >> I am getting `uninitialized constant Project::Forum::Topic` at >> app/controllers/home_controller.rb:46:in `discussions' >> >> I have code below and I am converting from `rails 2.3.x` to `rails >> 3.2.11`, I am thinking something wrong in `routes` setting. >> >> Any Idea How can I fix? >> >> models >> >> Project < ActiveRecord::Base >> # Relations under project model >> has_many :features, :dependent => :destroy >> has_many :forums, :class_name=>'Forum::Forum' >> has_many :topics, :class_name=>'Forum::Topic', :through=>:forums >> >> Forum::Forum < Feature >> # Relations under forum model >> has_many :topics, :class_name => 'Forum::Topic', :dependent => >> :destroy >> >> Feature < ActiveRecord::Base >> # Relations under feature model >> belongs_to :project >> >> Forum::Topic < ActiveRecord::Base >> # Relations under topic model >> belongs_to :forum, :foreign_key => :forum_id, :class_name => >> 'Forum::Forum', :include => :project >> >> home_controller.rb >> >> def discussions >> @project ||= Project.find_by_name 'help' >> @forums = @project.forums >> @topics = @project.topics.recent # HERE I AM GETTING ERRORS >> end >> >> routes.rb >> >> scope :home, :controller => "home", :activity => 'read' do >> get :discussions, :path => '/forums', :service_type => 'public' >> get :forums, :action => "discussions" >> end >> >> errors >> uninitialized constant Project::Forum::Topic >> app/controllers/home_controller.rb:46:in `discussions' >> >> -- >> You received this message because you are subscribed to the Google Groups >> "DeRailed - Denver Rails UG" group. >> To unsubscribe from this group and stop receiving emails from it, send an >> email to derailed+u...@googlegroups.com <javascript:>. >> For more options, visit https://groups.google.com/groups/opt_out. >> >> >> > > -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-talk+unsubscr...@googlegroups.com. To post to this group, send email to rubyonrails-talk@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msg/rubyonrails-talk/-/kbEEjH10HOgJ. For more options, visit https://groups.google.com/groups/opt_out.