2
I began to venture into the world of rubygems. I’m developing a Gem to generate my twitter bootstrap-style app’s Assets, as I intend to reuse my front-end code. All I need to do is put the Assets in the right places, add some helpers and make some settings. Several Gems that work this way make additions to the application.js/. css file at the time of installation. For example, bootstrap, when the command rails g bootstrap:install
is executed, the Assets are transferred to the proper path and a require is automatically added to the application.css and application.js.
I want to do something similar, only at a specific point of the application.br file. Being more exact, what I want is to add more folders to the Assets path. The file looks something like this:
class Application < Rails::Application
end
I need you to be like this:
class Application < Rails::Application
config.assets.paths << 'path/para/a/pasta'
end
But how would I ensure that this content will always be added within the class definition? I mean, simply adding to the file is simple, but in this case I can’t add outside the scope of the class.
Thanks! That’s just what I need!
– Pedro Vinícius