Currently, rails 2.3 engines can't have (or override) static files in
their own public/ directory like they do with views, controllers, etc.
Recently playing with rack, I implemented the following middleware:
As you can see, in environment.rb the middleware gets initialized with
the asset directories (which exists) from loaded plugins (may be there
is a way to check if those are engines?)
The middleware sees if the requested file is in one of the engines
providing a public/ directory. The first one that matches is returned
(an overlay just like the other components of engines work), if not,
the request is just passed to the application.
This feature is really useful. Now that I see how easy was to
implement, I wonder if it is a valid solution, and if the concept
could be used to add support in Rails itself for this, or if you guys
see a problem with this approach?