Upload
patrick-crowley
View
1.327
Download
0
Tags:
Embed Size (px)
Citation preview
Patrick Crowley
Rails for Legacy Apps
(How to use Railswith existing apps)
• New ideas
• New ideas
• No users
• New ideas
• No users
• Zero code investment
• New ideas
• No users
• Zero code investment
• Best case scenario
But, in the real world...
• Legacy content
• Legacy content
• Existing userbase
• Legacy content
• Existing userbase
• Front end (HTML + CSS)
• Legacy content
• Existing userbase
• Front end (HTML + CSS)
• Database Schema
Q: How can I use Rails with a legacy app?
• Don’t! (Leave site as is)
• Don’t! (Leave site as is)
• Reboot site with Rails
• Don’t! (Leave site as is)
• Reboot site with Rails
• Or, maybe...
Use Rails as a control panel to run your site
Case study:Cinema Treasures
PHP/MySQL
pMachine
Front-end
Smarty
Theater DBBlogs
How did we edit theaters?
phpMyAdmin(sadly)
• Intended for developers
• Intended for developers
• Easy to harm database
• Intended for developers
• Easy to harm database
• Doesn’t scale
Why not roll your own?
• Not highest priority
• Not highest priority
• Busy with other things
• Not highest priority
• Busy with other things
• I never want to write PHP again.
Let’s do it in Rails!
Basic concept
Database
Current site
Database
Current site Rails
Demo
Issues I ran into
• Non-plural table names
• Non-plural table names
• Had to remove primary id’s on join tables
• Non-plural table names
• Had to remove primary id’s on join tables
• Needed a way to delete cached templates on db update
How long did this take?
1 week / 2 - 3 hours per day
The End
0
1,500
3,000
4,500
6,000
2000 2001 2002 2003 2004 2005
New Theaters
0
12,500
25,000
37,500
50,000
2000 2001 2002 2003 2004 2005
New Comments