The Talk
This talk was given at RailsRemoteConf 2015.
Check out the SpeakerDeck! Video coming soon!
Want to split up your Rails app into pieces but not sure where to begin? Wish you could share controller code among microservices but don’t know how? Do you work on lots of projects and have boilerplate Rails code repeated in each?
Rails Engines may be your answer.
We will build a simple Rails engine and understand how this app-within-an-app architecture can help you write more modular code which can be gemified and reused across multiple projects.
Following Along
The video will be made public… eventually.
In the meantime, you can check out the code from the “live code” portion at https://github.com/amcaplan/forget and https://github.com/amcaplan/cacher. I also edited my notes from the live code portion, and published them at https://gist.github.com/amcaplan/0841065fdb69966b860f.
For your convenience, here are the links from the talk.
Links Throughout the Presentation
http://guides.rubyonrails.org/engines.html
https://github.com/rails/rails/blob/master/railties/lib/rails/application.rb#L79
http://weblog.rubyonrails.org/2005/11/11/why-engines-and-components-are-not-evil-but-distracting/
http://article.gmane.org/gmane.comp.lang.ruby.rails/29166
https://techblog.livingsocial.com/blog/2014/01/24/open-sourcing-with-rails-engines/
Further information links
GoGaRuCo 2012, Erik Michaels-Ober – “Writing a Rails Engine”
Ben Smith – “Leave your migrations in your Rails engines”
RailsConf 2015, Stephan Hagemann – “Get started with Component-based Rails applications!”
Brian Leonard, “Rails 4 Engines” (Blog post about splitting up an application)
Rocky Mountain Ruby 2013, Ben Smith – “How I architected my big Rails app for success!”
Stephan Hagemann, “Migrating from a single Rails app to a suite of Rails engines”
Will Read, “Experience Report: Engine Usage That Didn’t Work”