O'Reilly logo

Rails Plugins: Extending Rails Beyond the Core by James Adam

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Chapter 4. Sharing Code (lib)

It’s great being able to display information when your application starts, but typically you’ll want to enhance Rails applications in more interesting and useful ways than that. Most commonly, you’ll want to make one or more methods or classes available to the rest of your application.

The lib Directory

The two defining aspects of a plugin are the presence of the init.rb file and of a directory in the plugin called lib. If neither of these exists, then Rails will not recognize the subdirectory of vendor/plugins as a plugin. ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required