Sebastian
http://www.frozenplague.net
And if the table already exists you might want to add --skip-migration
script/generate scaffold person first_name:string last_name:string
--skip-migration
--
Rick DeNatale
My blog on Ruby
http://talklikeaduck.denhaven2.com/
I'm considering Ruby on Rails, but I already have a big database schema,
and I'd rather not re-type firstname:string lastname:string, for the
dozens of fields in my dozens of tables. Is there some way for Ruby to
build the scaffold based on what it finds in the existing database?
Wasn't that the whole point in previous versions? This seems like a big
step backwards....
--
Posted via http://www.ruby-forum.com/.
ruby script/generate scaffold game name:string
... what I get in my file structure is "games" (plural), but the table
in my existing database is "game" (singular). I then get SQL errors on
like "Table db.games doesn't exist."
http://www.frozenplague.net
Feel free to add me to MSN and/or GTalk as this email.
I'm a little late to the party here.
Try this from script/console
>> TableClass.columns.each { |c| puts c.inspect }; nil
You'll see a list of all the columns in the table, along with the data
types and names and so forth. It should be a pleasurable afternoon to
write a script that consumes this and generates a "script/generate
scaffold" command.