Hi engines developers,
I’m working on a project that uses Cells extensively
(http://nick.smt.de/trac/nick/wiki/Cells). Cells relies on Engines in
turn. I hit a wall when I tried to make cells load a class tree of
This was caused by the way Cells works, but I will not bother you with
the boring details of that.
I decided to rework the way cells loads its classes, and the best way to
this is via the autoload dependencies system, which is overridden by
This requires that the correct file is loaded not only when the user
to FooController (from controllers/foo_controller.rb), but also when the
user refers to FooCell (from cells/foo_cell.rb).
This can be done by copying over the entire
require_or_load_with_engine_additions and adding ‘cell’ to the
but that would be silly and very un-DRY. Instead, I propose this patch
(see attachment). It adds a new mattr_accessor Engines.file_types which
defaults to [‘controller’, ‘helper’]. Cells then adds to this so it
[‘controller’, ‘helper’, ‘cell’] and hacks the load paths in such a way
that the correct load paths are looked up.
In my opinion, this small patch paves the way for other cell-like
to Rails, so I would like to see this integrated in Engines.
Solide ICT - http://www.solide-ict.nl