Hi David,

One approach:

1. Grab Ryan Bates' nifty-generators gem -
http://github.com/ryanb/nifty-generators.
2. run rake db:schema:dump to grab your database info and add it to
schema.rb
3. Create or generate models for each your tables (skip migrations)
3. Run ./script/generate nifty_scaffold for each model (don't provide any
fields, it will auto-generate)

James

On Tue, Dec 8, 2009 at 9:42 AM, David <[email protected]> wrote:

> Hi all! This is one of those "I'm asking for a friend" type things. No
> really, I'm asking for a friend!
>
> 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.
>
> Naturally I laughed at him for a while. I've got no experience of
> dealing with legacy databases but told him that Rails wasn't really
> built for that.
>
> Any suggestions?
>
> Thanks
> David
>
> --
> SD Ruby mailing list
> [email protected]
> http://groups.google.com/group/sdruby
>

-- 
SD Ruby mailing list
[email protected]
http://groups.google.com/group/sdruby

Reply via email to