Top Banner
The Rails Engine That Could!!! Chooo Chooo!!! Andy Maleh - Grouptiva
7

The Rails Engine That Could

May 12, 2015

Download

Technology

AndyMaleh

That talk covered a successful utilization of Rails Engines in Rails 3 to modularize MVC features as reusable components. These components provide the best of both worlds, DRY reusable and easy to maintain code that is also extensible and customizable in every way necessary.
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: The Rails Engine That Could

The Rails Engine That

Could!!! Chooo Chooo!!!

Andy Maleh - Grouptiva

Page 2: The Rails Engine That Could

Problem

Difficulty reusing functionality cutting across:

Models

Views

Controllers

Assets (JS, CSS, Images)

Duplication across all web application layers.

Page 3: The Rails Engine That Could

Solution

Break common behavior into Rails Engines

Customize models/controllers/helpers in each project where needed by reopening classes

Customize Rails views in each project as needed by overriding templates

Link to Rails Engines in Gemfile via Git repo

Page 4: The Rails Engine That Could

Example

Common DomainRails

Engine

Recruiting System

Rails App

Athlete Profiles

Rails App

Client System

Rails App

Search PageRails

Engine

Page 5: The Rails Engine That Could

Benefits

Code reuse and productivity

Easier more organized maintainability

Minimize ripple effect when making changes

Project tests run faster by offloading some to Rails engines

Page 6: The Rails Engine That Could

Cost

Overhead in establishing a new Rails Engine gem project

More complexity

Have to upgrade ref numbers in Gemfile on every change (could be offset by symlinking)