On my first foray into the realm of Rails plugins, I decided to start a plugin that does a relevance search for a specified term. The plugin is still a work in progress, but the process of creating a creating a plugin is extremely simple. For the curious, you can find my search pluginĀ on my github page.
First create a rails app for your plugin (if you don’t already have one):
rails myapp
Then use the rails generator to create your plugin:
cd myapp/ script/generate plugin myplugin
Congratulations, you now have a plugin in your application that is just waiting for you to create it. As you edit the plugin, if you need to include files from the lib folder of the plugin, you can require them in the init.rb file in your plugin.
cd vendor/plugins/myplugin vi init.rb
# The following line will require the lib/myplugin.rb file # in your plugin. require 'myplugin'


