Martin Gamsjaeger
2006-May-14 15:49 UTC
[Rails] file and directory layout below app/models
Hiall, Is it possible to organize my model files below app/models into subfolders? E.g. I would like to put admin related models into their own subfolder. This kind of structuring works for controllers and views (scaffolding creates the right subfolder-model mappings), but app/models always stays flat. I''d really like to be able to group my code into logical, well packages :-) Yes, I come from the Java world :) cheers Martin
Martin Gamsjaeger
2006-May-14 17:08 UTC
[Rails] file and directory layout below app/models
I am posting this again with Subject "[Rails] .." in order to be caught by inbox filters :) Hiall, Is it possible to organize my model files below app/models into subfolders? E.g. I would like to put admin related models into their own subfolder. This kind of structuring works for controllers and views (scaffolding creates the right subfolder-model mappings), but app/models always stays flat. I''d really like to be able to group my code into logical, well packages :-) Yes, I come from the Java world :) cheers Martin
Martin Gamsjaeger wrote:> I am posting this again with Subject "[Rails] .." in order to be > caught by inbox filters :)The mailing list software handles this for you, don''t worry. Your first message had [Rails] in the subject line as well. Sorry I can''t help you with your question, just thought I''d point that out. -- Jakob Skjerning - http://mentalized.net
Martin Gamsjaeger
2006-May-14 18:48 UTC
[Rails] file and directory layout below app/models
Thx anyway Jakob :-) Gmail is not showing [Rails] in the subject if I don''t put it in there myself. Do you see it twice now? On 5/14/06, Jakob Skjerning <jakob@mentalized.net> wrote:> Martin Gamsjaeger wrote: > > I am posting this again with Subject "[Rails] .." in order to be > > caught by inbox filters :) > > The mailing list software handles this for you, don''t worry. Your first > message had [Rails] in the subject line as well. Sorry I can''t help you > with your question, just thought I''d point that out. > > -- > Jakob Skjerning - http://mentalized.net > _______________________________________________ > Rails mailing list > Rails@lists.rubyonrails.org > http://lists.rubyonrails.org/mailman/listinfo/rails >
Martin Gamsjaeger
2006-May-14 18:51 UTC
[Rails] file and directory layout below app/models
Doh, a typo! In my original post, the sentence (scaffolding creates the right subfolder-model mappings) should have read (scaffolding creates the right subfolder-module mappings) it is exactly those subfolder-model mappings that I miss so much ^^ cheers Martin
Have you tried using modules? Controllers work that way.. maybe models should be able to as well. in app/models/admin/user.rb: module Admin class User ... end end and see if that works for you. I''m away from my home machine now, so I can''t try it for you. On 5/14/06, Martin Gamsjaeger <gamsnjaga@gmail.com> wrote:> > Doh, a typo! In my original post, the sentence > > (scaffolding creates the right subfolder-model mappings) > should have read > (scaffolding creates the right subfolder-module mappings) > > it is exactly those subfolder-model mappings that I miss so much ^^ > > > cheers > Martin > > _______________________________________________ > Rails mailing list > Rails@lists.rubyonrails.org > http://lists.rubyonrails.org/mailman/listinfo/rails > > >-- http://blog.mauricecodik.com -------------- next part -------------- An HTML attachment was scrubbed... URL: http://wrath.rubyonrails.org/pipermail/rails/attachments/20060514/a0429486/attachment.html
Martin Gamsjaeger
2006-May-14 21:46 UTC
[Rails] file and directory layout below app/models
Hi Maurice, Unfortunately that didn''t work. Rails complains about a missing source file then .. On 5/14/06, Maurice Codik <maurice.codik@gmail.com> wrote:> > Have you tried using modules? Controllers work that way.. maybe models > should be able to as well. > > in app/models/admin/user.rb: > > module Admin > class User > ... > end > end > > and see if that works for you. I''m away from my home machine now, so I can''t > try it for you. > > > On 5/14/06, Martin Gamsjaeger <gamsnjaga@gmail.com> wrote: > > > Doh, a typo! In my original post, the sentence > > (scaffolding creates the right subfolder-model mappings) > should have read > (scaffolding creates the right subfolder-module mappings) > > it is exactly those subfolder-model mappings that I miss so much ^^ > > > cheers > Martin > > _______________________________________________ > > Rails mailing list > Rails@lists.rubyonrails.org > http://lists.rubyonrails.org/mailman/listinfo/rails > > > > > > > -- > http://blog.mauricecodik.com > _______________________________________________ > Rails mailing list > Rails@lists.rubyonrails.org > http://lists.rubyonrails.org/mailman/listinfo/rails > > >