Sunday, May 1, 2011

How to develop rails plugin from scratch?

Generate Plugin with command: ruby script/generate plugin hello_world
It will create file system as bellow:
- lib
    - hello_world.rb
- tasks
    - hello_world_tasks.rake
- test
    - hello_world_test.rb
- init.rb
- install.rb
- uninstall.rb
- README
- Rakefile
- MIT-LICENSE

init.rb will be executed every time when your application runs. Generally hook code is to be included here like you want to make all methods of your plugin available in your app’s models, controllers, views and helpers

http://abdul-barek-rails.blogspot.com/2010/02/how-to-develop-rails-plugin-from.html

No comments: