I have a set of css files which I use in almost all projects. I would like to create a gem which has a generator inside it. I managed to write some code using the tutorial given here http://guides.rubyonrails.org/generators.html
However i am not sure about how to move this to a gem and use a command like device install ....
There are actually two ways of doing this (and both involve a Rails Engine afaik).
To create an engine just follow this guide: http://edgeguides.rubyonrails.org/engines.html.
Just without the mountable option and anything you put inside your app/assets/stylesheet directory will be available through require inside your CSS manifest.
The relevant part in the guide is in 6.4 besides the general boilerplate setup you have to do.
For a generateor the same applies, you just have to put the generator in the generators directory as you would with the app and can then run it from there with the engine prefix.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With