On Thursday 16 September 2010, elliottg wrote:
I am working on a Rails CMS gem. I want the Gem to have its own
Public dir (like Rails) to hold css/js/images etc… I have been
trying a lot of different pathing options from my Gem-centric views,
but no matter what I try I can’t target any of the files.
I don’t think you can do what you’re trying to do in Rails alone,
however, I’d appreciate to be shown wrong. The reason is that public is
not handled by your application at all. Rather, requests to files in
public are handled by the web server – and that’s a good thing, because
apache or nginx are much faster at serving static files than Rails
proper would be.
I take it, the usual way to add assets from a gem is to include a
generator that copies (or links) these assets to the application’s