Do you mean that every class in the engine 'MyEngine' should be put
into the module MyEngine?

i.e. class User < ActiveRecord::Base automatically becomes class
MyEngine::User < ActiveRecord::Base ?

While something like this is superficially appealing, it's actually
way more complicated to implement (even Rails doesn't support this
yet) and IMHO adding 'more magic' at this point isn't a brilliant
idea.

When you're writing a regular Rails application, any controllers that
are within modules have to reside in a sub-folder of the
app/controllers directory - there's no way around that. This is
mirrored directly in the way that Engines work - if you want your
controllers to be in modules, you have to put them in subfolders; the
fact they're in an engine isn't important.

The way that Rails controllers exist within Modules is pretty much a
hack in Rails itself right now. The module is half there for reloading
purposes, and half for routing (i.e. to let you put controllers under
subdirectories on your site).

So to answer your point - it's no more or no less elegant than if you
were developing the controllers in your application directly. Only
time will tell how things might be improved.

- james

On 2/3/06, Manuel Holtgrewe <[EMAIL PROTECTED]> wrote:
>
> Am 03.02.2006 um 17:55 schrieb James Adam:
>
> > You need to remembered to put your modularized controllers into
> > subfolders, i.e. "class ActiveRbac::UserController < .... " would go
> > into ./vendor/plugins/active_rbac/app/controllers/active_rbac/
> > user_controller.rb....
>
> OK.
>
> IMO this is not exactly elegant. Shouldn't all classes be prefixed by
> the engine's name automatically?
>
> Regards
>
> Manuel Holtgrewe
>
>
> _______________________________________________
> engine-developers mailing list
> [email protected]
> http://lists.rails-engines.org/listinfo.cgi/engine-developers-rails-engines.org
>


--
* J *
  ~
_______________________________________________
engine-developers mailing list
[email protected]
http://lists.rails-engines.org/listinfo.cgi/engine-developers-rails-engines.org

Reply via email to