SlideShare a Scribd company logo
Rails Engine
An awesome tool to extend your rails application




               Muntasim Ahmed
   Platform Architect @ Tasawr Interactive
         https://github.com/railscash
            muntasim@tasawr.com
Agenda

•   Why Rails Engine
•   What is Rails Engine
•   How it works with Rails Core
•   Who are they
•   Where is your interest
Problems
• Large application without reusable component
• Slow testing ( if any :) )
• Larger app, messy
Solution
• Find common functionalities
• Extract them to module => Gems
• Use railtie to tie with Rails App => Rails Engine
One Thing!

Rails (version>=3.1) is just a “supercharged” engine

               http://edgeguides.rubyonrails.org/engines.html
Rails Engine ?

• pre-packaged application
• able to be run or mounted within another Rails
  application
• can have its own models, views, controllers,
  generators and publicly served static files
Rails Engine ?

•
Rails Engine has




      Image source: Railscasts.com
Rails Engine has




     Image source: Google
Rails Engine has




        Image source: Google
Rails Engine has




         Image source: Google
Rails engine walk-through
•   Create an engine
•   Implement requirements in app, lib etc.
•   Test
•   Mount to main app
•   Override where necessary
•   And done!
Rails engine walk-through

Create
rails plugin new awesome_engine --mountable

Then generate mvc stuffs, test


In App Gemfile
gem "awesome_engine", path => "awesome_engine_path


In App Route
mount AwesomeEngine::Engine => "/awesome_engine_path", as =>
“awesome_engine"
Rails engine walk-through

Hit localhost:3000/awesome_engine_path
                                    (mount point)

It will hit engine's root path



     Welcome to awesome engine
               home!
Rails engine walk-through

Routes:

Use engine routes from main app using
engine_name.route_name

e.g.   awesome_name.root_path
Rails engine walk-through

Routes:

Use main app routes from engine using
main_app.route_name

e.g. main_app.root_path
Who are they

•   Rails Admin
•   Devise
•   Blogit
•   Tolk
•   .....
References

•   http://railscasts.com/episodes/277-mountable-engines
•   http://www.slideshare.net/AndyMaleh/rails-engine-patterns
•   http://www.slideshare.net/mirrec/rails-engine-rubyslava
•   http://edgeguides.rubyonrails.org/engines.html
•   http://edgeapi.rubyonrails.org/classes/Rails/Engine.html
•   http://pivotallabs.com/users/shagemann/blog/articles/1994-
    migrating-rom-a-single-rails-app-to-a-suite-of-rails-engines



                                                    Image source:
                                Google, Railscasts and Dulal Khan
Thanks for your attention :)
???

Question(s)

More Related Content

What's hot (20)

PDF
React.js for Rails Developers
Arkency
 
PDF
Rails Engines as a way to Micro services
Lucas Alencar
 
PDF
React on rails v6.1 at LA Ruby, November 2016
Justin Gordon
 
PDF
How angularjs saves rails
Michael He
 
PDF
Project Fedena and Why Ruby on Rails - ArvindArvind G S
ThoughtWorks
 
PDF
AngularJS meets Rails
Elena Torró
 
KEY
How to set up and test a Rails 3 Engine
nicholasf
 
PPTX
API Development with Laravel
Michael Peacock
 
PDF
AEM - A Collection of developer friendly tools
Ashokkumar T A
 
PPTX
Brief Introduction to Ember
Vinay B
 
KEY
Backbonification for dummies - Arrrrug 10/1/2012
Dimitri de Putte
 
PDF
Laravel Restful API and AngularJS
Blake Newman
 
PDF
An Intense Overview of the React Ecosystem
Rami Sayar
 
PDF
Be Happy With Ruby on Rails - Ecosystem
Lucas Renan
 
PDF
Web Development with Laravel 5
Soheil Khodayari
 
PPT
Story ofcorespring infodeck
Makarand Bhatambarekar
 
PDF
RoR 101: Session 5
Rory Gianni
 
PPT
Slim3 quick start
Guangyao Cao
 
PDF
RoR 101: Session 3
Rory Gianni
 
PPTX
EmberJS BucharestJS
Remus Rusanu
 
React.js for Rails Developers
Arkency
 
Rails Engines as a way to Micro services
Lucas Alencar
 
React on rails v6.1 at LA Ruby, November 2016
Justin Gordon
 
How angularjs saves rails
Michael He
 
Project Fedena and Why Ruby on Rails - ArvindArvind G S
ThoughtWorks
 
AngularJS meets Rails
Elena Torró
 
How to set up and test a Rails 3 Engine
nicholasf
 
API Development with Laravel
Michael Peacock
 
AEM - A Collection of developer friendly tools
Ashokkumar T A
 
Brief Introduction to Ember
Vinay B
 
Backbonification for dummies - Arrrrug 10/1/2012
Dimitri de Putte
 
Laravel Restful API and AngularJS
Blake Newman
 
An Intense Overview of the React Ecosystem
Rami Sayar
 
Be Happy With Ruby on Rails - Ecosystem
Lucas Renan
 
Web Development with Laravel 5
Soheil Khodayari
 
Story ofcorespring infodeck
Makarand Bhatambarekar
 
RoR 101: Session 5
Rory Gianni
 
Slim3 quick start
Guangyao Cao
 
RoR 101: Session 3
Rory Gianni
 
EmberJS BucharestJS
Remus Rusanu
 

Similar to Rails Engine :: modularize you app (20)

PPT
Rails engines
Grzegorz Witek
 
PPTX
Rails engine
Jyaasa Technologies
 
PDF
Ember App Kit & The Ember Resolver
tboyt
 
PPT
Rails engines
Josh Schramm
 
PDF
Rails Engines
sean_todd
 
PDF
Moving complex enterprise ecommerce systems to the cloud
Elastic Path
 
PDF
Client Side MVC with Backbone and Rails
Tom Z Zeng
 
PDF
Rails request & middlewares
Santosh Wadghule
 
PDF
Rails engines
Mohammed Gharbi
 
PPT
Revised Rails Engine Patterns for Montreal.rb meetup Oct 16, 2012
Andy Maleh
 
PDF
Rails Engines - A presentation for the 22nd Athens Ruby Meetup
Skroutz S.A.
 
PDF
Rails Engines
Dimitrios Zorbas
 
PDF
Latest & interesting updates #android dev
Paresh Mayani
 
PDF
Riding the Edge with Ember.js
aortbals
 
PPTX
Ruby on Rails Penetration Testing
3S Labs
 
PDF
Learning Rails
David Francisco
 
PDF
Introduction to Ember.js and how we used it at FlowPro.io
Paul Knittel
 
PDF
Lightening a component based Rails architecture
Enrico Teotti
 
PPTX
Selenium topic 3 -Web Driver Basics
ITProfessional Academy
 
PDF
End to-End SPA Development Using ASP.NET and AngularJS
Gil Fink
 
Rails engines
Grzegorz Witek
 
Rails engine
Jyaasa Technologies
 
Ember App Kit & The Ember Resolver
tboyt
 
Rails engines
Josh Schramm
 
Rails Engines
sean_todd
 
Moving complex enterprise ecommerce systems to the cloud
Elastic Path
 
Client Side MVC with Backbone and Rails
Tom Z Zeng
 
Rails request & middlewares
Santosh Wadghule
 
Rails engines
Mohammed Gharbi
 
Revised Rails Engine Patterns for Montreal.rb meetup Oct 16, 2012
Andy Maleh
 
Rails Engines - A presentation for the 22nd Athens Ruby Meetup
Skroutz S.A.
 
Rails Engines
Dimitrios Zorbas
 
Latest & interesting updates #android dev
Paresh Mayani
 
Riding the Edge with Ember.js
aortbals
 
Ruby on Rails Penetration Testing
3S Labs
 
Learning Rails
David Francisco
 
Introduction to Ember.js and how we used it at FlowPro.io
Paul Knittel
 
Lightening a component based Rails architecture
Enrico Teotti
 
Selenium topic 3 -Web Driver Basics
ITProfessional Academy
 
End to-End SPA Development Using ASP.NET and AngularJS
Gil Fink
 
Ad

Recently uploaded (20)

PPTX
Digital Circuits, important subject in CS
contactparinay1
 
PDF
How do you fast track Agentic automation use cases discovery?
DianaGray10
 
PPTX
New ThousandEyes Product Innovations: Cisco Live June 2025
ThousandEyes
 
PDF
Transcript: Book industry state of the nation 2025 - Tech Forum 2025
BookNet Canada
 
PPTX
The Project Compass - GDG on Campus MSIT
dscmsitkol
 
PDF
NASA A Researcher’s Guide to International Space Station : Physical Sciences ...
Dr. PANKAJ DHUSSA
 
PPTX
MuleSoft MCP Support (Model Context Protocol) and Use Case Demo
shyamraj55
 
PDF
Reverse Engineering of Security Products: Developing an Advanced Microsoft De...
nwbxhhcyjv
 
DOCX
Python coding for beginners !! Start now!#
Rajni Bhardwaj Grover
 
PDF
What’s my job again? Slides from Mark Simos talk at 2025 Tampa BSides
Mark Simos
 
PDF
Book industry state of the nation 2025 - Tech Forum 2025
BookNet Canada
 
PDF
LOOPS in C Programming Language - Technology
RishabhDwivedi43
 
PPTX
Agentforce World Tour Toronto '25 - MCP with MuleSoft
Alexandra N. Martinez
 
PDF
Staying Human in a Machine- Accelerated World
Catalin Jora
 
PPTX
COMPARISON OF RASTER ANALYSIS TOOLS OF QGIS AND ARCGIS
Sharanya Sarkar
 
PPTX
Future Tech Innovations 2025 – A TechLists Insight
TechLists
 
PDF
Agentic AI lifecycle for Enterprise Hyper-Automation
Debmalya Biswas
 
DOCX
Cryptography Quiz: test your knowledge of this important security concept.
Rajni Bhardwaj Grover
 
PPT
Ericsson LTE presentation SEMINAR 2010.ppt
npat3
 
PDF
SIZING YOUR AIR CONDITIONER---A PRACTICAL GUIDE.pdf
Muhammad Rizwan Akram
 
Digital Circuits, important subject in CS
contactparinay1
 
How do you fast track Agentic automation use cases discovery?
DianaGray10
 
New ThousandEyes Product Innovations: Cisco Live June 2025
ThousandEyes
 
Transcript: Book industry state of the nation 2025 - Tech Forum 2025
BookNet Canada
 
The Project Compass - GDG on Campus MSIT
dscmsitkol
 
NASA A Researcher’s Guide to International Space Station : Physical Sciences ...
Dr. PANKAJ DHUSSA
 
MuleSoft MCP Support (Model Context Protocol) and Use Case Demo
shyamraj55
 
Reverse Engineering of Security Products: Developing an Advanced Microsoft De...
nwbxhhcyjv
 
Python coding for beginners !! Start now!#
Rajni Bhardwaj Grover
 
What’s my job again? Slides from Mark Simos talk at 2025 Tampa BSides
Mark Simos
 
Book industry state of the nation 2025 - Tech Forum 2025
BookNet Canada
 
LOOPS in C Programming Language - Technology
RishabhDwivedi43
 
Agentforce World Tour Toronto '25 - MCP with MuleSoft
Alexandra N. Martinez
 
Staying Human in a Machine- Accelerated World
Catalin Jora
 
COMPARISON OF RASTER ANALYSIS TOOLS OF QGIS AND ARCGIS
Sharanya Sarkar
 
Future Tech Innovations 2025 – A TechLists Insight
TechLists
 
Agentic AI lifecycle for Enterprise Hyper-Automation
Debmalya Biswas
 
Cryptography Quiz: test your knowledge of this important security concept.
Rajni Bhardwaj Grover
 
Ericsson LTE presentation SEMINAR 2010.ppt
npat3
 
SIZING YOUR AIR CONDITIONER---A PRACTICAL GUIDE.pdf
Muhammad Rizwan Akram
 
Ad

Rails Engine :: modularize you app

  • 1. Rails Engine An awesome tool to extend your rails application Muntasim Ahmed Platform Architect @ Tasawr Interactive https://github.com/railscash [email protected]
  • 2. Agenda • Why Rails Engine • What is Rails Engine • How it works with Rails Core • Who are they • Where is your interest
  • 3. Problems • Large application without reusable component • Slow testing ( if any :) ) • Larger app, messy
  • 4. Solution • Find common functionalities • Extract them to module => Gems • Use railtie to tie with Rails App => Rails Engine
  • 5. One Thing! Rails (version>=3.1) is just a “supercharged” engine http://edgeguides.rubyonrails.org/engines.html
  • 6. Rails Engine ? • pre-packaged application • able to be run or mounted within another Rails application • can have its own models, views, controllers, generators and publicly served static files
  • 8. Rails Engine has Image source: Railscasts.com
  • 9. Rails Engine has Image source: Google
  • 10. Rails Engine has Image source: Google
  • 11. Rails Engine has Image source: Google
  • 12. Rails engine walk-through • Create an engine • Implement requirements in app, lib etc. • Test • Mount to main app • Override where necessary • And done!
  • 13. Rails engine walk-through Create rails plugin new awesome_engine --mountable Then generate mvc stuffs, test In App Gemfile gem "awesome_engine", path => "awesome_engine_path In App Route mount AwesomeEngine::Engine => "/awesome_engine_path", as => “awesome_engine"
  • 14. Rails engine walk-through Hit localhost:3000/awesome_engine_path (mount point) It will hit engine's root path Welcome to awesome engine home!
  • 15. Rails engine walk-through Routes: Use engine routes from main app using engine_name.route_name e.g. awesome_name.root_path
  • 16. Rails engine walk-through Routes: Use main app routes from engine using main_app.route_name e.g. main_app.root_path
  • 17. Who are they • Rails Admin • Devise • Blogit • Tolk • .....
  • 18. References • http://railscasts.com/episodes/277-mountable-engines • http://www.slideshare.net/AndyMaleh/rails-engine-patterns • http://www.slideshare.net/mirrec/rails-engine-rubyslava • http://edgeguides.rubyonrails.org/engines.html • http://edgeapi.rubyonrails.org/classes/Rails/Engine.html • http://pivotallabs.com/users/shagemann/blog/articles/1994- migrating-rom-a-single-rails-app-to-a-suite-of-rails-engines Image source: Google, Railscasts and Dulal Khan
  • 19. Thanks for your attention :)