Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Plays Well with Others: Building Mountable Apps

peakpg
March 24, 2012

Plays Well with Others: Building Mountable Apps

Rails 3.1 introduced Engines, a great way to create reusable components to share between Rails applications. This provides an overview of how to build and use Engines based on my experience upgrading BrowserCMS to work with with Engines.

peakpg

March 24, 2012
Tweet

More Decks by peakpg

Other Decks in Programming

Transcript

  1. Agenda • What is an Engine? • Building an Engine • Providing Rails

    Configuration • Easy to Install • Asset Pipeline • Working with other Engines
  2. Route Helpers <%= main_app.root_url %> # => / <%= another.root_url

    %> # => /another <%= another.page_path(@page) %> # => /another/pages/1
  3. From Gem to Project $ rake another:install:migrations • Copies all files

    from db/migrate into a project • Won’t overwrite • Retimestamps
  4. Write a Readme gem "another" $ bundle install $ rake

    another:install:migrations $ rake db:migrate mount Another::Engine => "/another"