Plugins - lightrail
Add to favoritesLightrail is a ruby on rails plugin generator intended to make it easier to share controllers, models, helpers, views and migrations across multiple apps without hacking Rails internals.
Basically, lightrail is a scaffold generator that generates the code into a plugin, rather than the main app directory.
== Installation
- Install the plugin
Via standard git clone:
Via piston see http://blog.teksol.info/2008/3/15/piston-2-0-progress-piston-can-import-all-four-cases for details
Via rails plugin (requires edge)
- Generate your plugin generator
Once the plugin is installed, you can create a plugin which will store your reusable code.
- Install your reusable code with your plugin generator
Once you‘ve generated your plugin, you‘ll see that there is a new generator available. If you ran script/generate lightrailplugin zilkey/product your generator would be named zilkeyproduct
When you run your own generator, it:
- Copies the controller, model, helper and views to the appropriate app directory
- Copies all of the migrations in the plugins lib/db/migrate directory to the app‘s db/migrate directory
h2. Example
Then open your web browser and navigate to http://localhost:3000/articles
