Unique Marketing, Guaranteed Results.

Rails Plugins: Couldn’t be Easier!

April 1st, 2009 by Chuck Wood

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'
  • Facebook
  • Google Bookmarks
  • email
  • NewsVine
  • Slashdot
  • Technorati
  • Yahoo! Buzz
  • BlinkList
  • Print
  • Propeller
Filed under: Programming — Chuck Wood @ 2:57 pm on April 1, 2009

No Comments

No comments yet.

RSS feed for comments on this post. TrackBack URL

Leave a comment


Copyright © 2005-2010 PMA Media Group. All Rights Reserved . Online Degrees | Train for a Better Career | My Colleges and Careers Site Map