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

Get Rails Plugins: Extending Rails Beyond the Core now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.