I have alot of models that are all linked. They are cluttering up my app/models directory. Is it possible to move some of my models into a sub directory. (i.e. app/models/items) Will Rails still pick these up? Do I need to change any configuration settings? Thanks in advance Iain Adams --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
Frederick Cheung
2008-Jul-08 16:56 UTC
Re: Can I put seperate models into different directories
On 8 Jul 2008, at 17:51, Iain Adams wrote:> > I have alot of models that are all linked. They are cluttering up my > app/models directory. Is it possible to move some of my models into a > sub directory. (i.e. app/models/items) Will Rails still pick these up? > Do I need to change any configuration settings? >see http://blog.hasmanythrough.com/2008/5/6/a-simple-alternative-to-namespaced-models Fred> Thanks in advance > > Iain Adams > >--~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
KathysKode-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org
2008-Jul-09 14:29 UTC
Re: Can I put seperate models into different directories
Mr. Cheung, I''ve tried all many of accomplishing of splitting my many models into subdirectories as displayed in the link you provide and one other. Each time I get an error message such as; LoadError in Evidence/dispcodesController#index Expected D:/Rails/itracker/app/models/evidence/dispcode.rb to define Evidence::Dispcode The two approaches I''ve tried are; 1. config.load_paths += %W( #{RAILS_ROOT}/app/models/evidence) Josh''s approach 2. Dir.glob("#{RAILS_ROOT}/app/models/**/*").each {|d| config.load_paths << d if File.directory?(d) } I wouldl be thrilled to make this work for all of the reaons that Josh explained. Note that all of the controllers are in sub folders to reflect their function. Thank you, Kathleen On Jul 8, 10:56 am, Frederick Cheung <frederick.che...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> On 8 Jul 2008, at 17:51, Iain Adams wrote: > > > > > I have alot of models that are all linked. They are cluttering up my > > app/models directory. Is it possible to move some of my models into a > > sub directory. (i.e. app/models/items) Will Rails still pick these up? > > Do I need to change any configuration settings? > > seehttp://blog.hasmanythrough.com/2008/5/6/a-simple-alternative-to-names... > > Fred > > > Thanks in advance > > > Iain Adams--~--~---------~--~----~------------~-------~--~----~ 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@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Matthew Rudy Jacobs
2008-Jul-09 15:33 UTC
Re: Can I put seperate models into different directories
Frederick Cheung wrote:> see > http://blog.hasmanythrough.com/2008/5/6/a-simple-alternative-to-namespaced-models > > FredI''m sure someone blogged about that way before him... http://rudyonrails.blogspot.com/2007/06/cleaning-up-your-models-folder.html albeit a horrible looking, poorly maintained, blogger blog. -- 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 -~----------~----~----~----~------~----~------~--~---