Plugins - lightrail

StarAdd to favorites

Lightrail 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

  1. Install the plugin

Via standard git clone:

git clone git://github.com/zilkey/lightrail.git vendor/plugins/lightrail

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)

script/plugin install git://github.com/zilkey/lightrail.git

  1. Generate your plugin generator

Once the plugin is installed, you can create a plugin which will store your reusable code.

script/generate lightrailplugin namespace/modelname some:string column:string names:string

  1. 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

script/generate zilkey_product

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

rails lightrail-demo cd lightrail-demo git clone git://github.com/zilkey/lightrail.git vendor/plugins/lightrail script/generate lightrailplugin zilkey/article name:string publishedat:datetime script/generate zilkey_article rake db:migrate script/server

Then open your web browser and navigate to http://localhost:3000/articles

Jeff Dean

http://lightrail.zilkey.com/

git://github.com/zilkey/lightrail.git

Rails' (MIT)

  • Currently 1.4/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

Rails Engines

Tags

Comments

Add a comment

Search Plugins

Query syntax

Plugins by Category

Sponsors

Rails Kits: Get Code. Get Moving.

Have a comment?