Rails Engines - what, why, how
Grzegorz Witek
Agenda
• What engines are
• How they appeared in Rails core
• How to use them
• What are their pros and cons
• Summary
What engines are
Application
Engine
Plugins
What are their capabilities?
Rails engines have:
Rack middleware stack
What are their capabilities?
Rails engines have:
environment.rb
What are their capabilities?
Rails engines have:
Routes
What are their capabilities?
Rails engines have:
Plugin support
Long way to the CORE
• Plugin
• Rails 2.3 - partial support
• 2010 Ruby Summer of Code
• Rails 3.1 - full engines in core
...
A bit of code
Rails.application.routes.draw do mount Cms::Engine => "/portal", :as
=> 'cms' end
main_application.root_path...
Are they really worth using?
Pros:
• they are almost as
powerful as rails app
• they are isolated (you don't
need to chang...
Do they exist?
• Devise
• Rails Admin
• Rails Assets (to be released in 3.1)
• Tolk
Any questions?
Thanks for your attention!
Sources:
• http://piotrsarnacki.com
• https://github.com/dhh/tolk
• http://rails-engines.org/ 
• http://railscasts.com/epi...
Upcoming SlideShare
Loading in …5
×

Rails engines

1,935 views
1,873 views

Published on

Published in: Education, Technology
0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total views
1,935
On SlideShare
0
From Embeds
0
Number of Embeds
35
Actions
Shares
0
Downloads
21
Comments
0
Likes
0
Embeds 0
No embeds

No notes for slide

Rails engines

  1. 1. Rails Engines - what, why, how Grzegorz Witek
  2. 2. Agenda • What engines are • How they appeared in Rails core • How to use them • What are their pros and cons • Summary
  3. 3. What engines are Application Engine Plugins
  4. 4. What are their capabilities? Rails engines have: Rack middleware stack
  5. 5. What are their capabilities? Rails engines have: environment.rb
  6. 6. What are their capabilities? Rails engines have: Routes
  7. 7. What are their capabilities? Rails engines have: Plugin support
  8. 8. Long way to the CORE • Plugin • Rails 2.3 - partial support • 2010 Ruby Summer of Code • Rails 3.1 - full engines in core • ... • 2011? - a few apps in the same process
  9. 9. A bit of code Rails.application.routes.draw do mount Cms::Engine => "/portal", :as => 'cms' end main_application.root_pathcms.articles_path rake railties:copy_migrations authenticate :admin do mount Tolk::Engine => "/tolk" end
  10. 10. Are they really worth using? Pros: • they are almost as powerful as rails app • they are isolated (you don't need to change your code to use them!) • You can share code between applications • they can save your time! Cons: • they're not suitable for every application
  11. 11. Do they exist? • Devise • Rails Admin • Rails Assets (to be released in 3.1) • Tolk
  12. 12. Any questions? Thanks for your attention!
  13. 13. Sources: • http://piotrsarnacki.com • https://github.com/dhh/tolk • http://rails-engines.org/  • http://railscasts.com/episodes/149-rails-engines • http://github.com/sferik/rails_admin • https://github.com/lazyatom/engines • https://github.com/rails/rails

×