I know we could arrange controllers as modules. Can we also arrange models in modules? -- Rgds, --Siva Jagadeesan http://www.varcasa.com/ My First Rails Project. Education Through Collabration -------------- next part -------------- An HTML attachment was scrubbed... URL: http://wrath.rubyonrails.org/pipermail/rails/attachments/20060214/d65f88c2/attachment.html
On 13-Feb-06, at 9:03 PM, Siva Jagadeesan wrote:> I know we could arrange controllers as modules. Can we also arrange > models in modules?No you cannot. I dont see the need why any one would want to do it too. Have you looked at components? Best Regards, Warren Noronha. GNU (http://www.gnu.org.in)
The reason I need is it package (make a module) for group of related modules. Something like a package in java On 2/14/06, Warren Noronha <warren@gnu.org.in> wrote:> > > On 13-Feb-06, at 9:03 PM, Siva Jagadeesan wrote: > > > I know we could arrange controllers as modules. Can we also arrange > > models in modules? > > No you cannot. I dont see the need why any one would want to do it too. > > Have you looked at components? > > Best Regards, > Warren Noronha. > GNU (http://www.gnu.org.in) > > > > _______________________________________________ > Rails mailing list > Rails@lists.rubyonrails.org > http://lists.rubyonrails.org/mailman/listinfo/rails >-- Rgds, --Siva Jagadeesan http://www.varcasa.com/ My First Rails Project. Education Through Collabration -------------- next part -------------- An HTML attachment was scrubbed... URL: http://wrath.rubyonrails.org/pipermail/rails/attachments/20060214/5193beca/attachment.html
On Feb 13, 2006, at 9:34 PM, Warren Noronha wrote:> > On 13-Feb-06, at 9:03 PM, Siva Jagadeesan wrote: > >> I know we could arrange controllers as modules. Can we also >> arrange models in modules? > > No you cannot. I dont see the need why any one would want to do it > too. > > Have you looked at components? > > Best Regards, > Warren Noronha. > GNU (http://www.gnu.org.in) >Actually yes you can do that. There is support built into edge rails recently to enable using modules as namespaces for your models. Here is what you have to do if you are running 1.0.0. Add this line in side the environment.rb file inside the Rails::Initializer.run do | config| block: # Add support to use models in modules for namespaces. config.controller_paths << File.join(::RAILS_ROOT, ''app'', ''models'') Its a little weird becuase you use controller_paths but it will let you use Admin::Page < AR::Base for your models to have them namespaced inside of modules. This is the same way that components are able to load their models and stuff. There has been support recently added to use this by default on edge rails. Cheers- -Ezra Zygmuntowicz WebMaster Yakima Herald-Republic Newspaper ezra@yakima-herald.com 509-577-7732