O'Reilly logo

Crafting Rails 4 Applications, 2nd Edition by José Valim

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

Creating Your First Rails Plug-in

If you already have Rails installed, you’re ready to craft your first plug-in. Let’s call this plug-in pdf_renderer:

 
$ ​rails plugin new pdf_renderer

When we run this command we see the following output:

 
create
 
create README.rdoc
 
create Rakefile
 
create pdf_renderer.gemspec
 
create MIT-LICENSE
 
create .gitignore
 
create Gemfile
 
create lib/pdf_renderer.rb
 
create lib/tasks/pdf_renderer_tasks.rake
 
create lib/pdf_renderer/version.rb
 
create test/test_helper.rb
 
create test/pdf_renderer_test.rb
 
append Rakefile
 
vendor_app test/dummy
 
run bundle install

This command creates the basic plug-in structure, containing a pdf_renderer.gemspec file, a Rakefile, a Gemfile, and the lib and test folders. ...

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