On Dec 8, 2009, at 9:42 AM, David wrote: > So he has this 'legacy' mySQL database and wants to build a new > version of the site in Rails. > > His desire is to get Rails to build scaffolds for him based on his > database's schema. Without having to sit there and type out every > table and every column in the script/generate scaffold command.
I must admit I've never understood the need for scaffolds. I've built two large Rails apps on top of legacy database designs. I simply use Rails' overrides to set the primary_key, table_name, and foreign_key, then I use a decent database GUI to fiddle with the data(*). From what I see, scaffolding gives you a web based GUI to enter some dummy data while you work out a front end, and maybe fiddle a little with what you might want for an admin system. The thing with a legacy app is that you already have the schema, you already have data, and you probably already know what admin features you need because something already exists. IMO just start building the proper back end you want for production, and use a DB GUI for access to the data until it is ready. As James said, Rails can extract the schema in a way that allows you to go forward with migrations for on- going changes. I dunno, that's what I do. Watching demos of scaffolding, I just don't see how it's any better, but maybe I'm missing something. So, let this either encourage "your friend" (pffft) to take this route, or let this expose my heretic ways and let the public flogging begin. (*) 1.times do |shameless_plug| # I use Araelium Querious for rattling around inside MySQL. # My son and I got tired of the lame/ugly alteratives so we designed our own. # MySQL 5 on OS X Leopard+ at the moment, more DBs eventually to come # First objective was to do what CocoaMySQL tried to do but with better UI and no bugs # Next, will come the higher order functionality. # http://www.araelium.com/querious/ end -- greg willits -- SD Ruby mailing list [email protected] http://groups.google.com/group/sdruby
