Am 03.02.2006 um 18:55 schrieb James Adam:
> 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.
Actually, it would be enough if I could write this in my active_rbac
engine:
class ActiveRbac::UserController
# ...
end
This means that the load-routing would have to be changed...
> 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).
Do you by chance know where to look for that magic in Rails? I want
to have a look and could drop half an our searching if you know it
off your head.
Regards
Manuel Holtgrewe
_______________________________________________
engine-developers mailing list
[email protected]
http://lists.rails-engines.org/listinfo.cgi/engine-developers-rails-engines.org