On Fri, Apr 15, 2011 at 4:12 PM, Lee [email protected] wrote:
Am I correct in assuming that to bolt a Rails 3 GUI onto an existing
database you have to manually define the fields for each table in the
You don’t have to manually define them in the generate command. You can
them by hand later.
If so, what happened to DRY and when is this
support expected for Rails 3?
DRY is a concept. It means Don’t Repeat Yourself. The concept is applied
how you program your application. An example of violating DRY would be
having the same method in three different places in your app. Having to
define fields for a legacy database that you are now bolting a Rails app
is not a violation of this concept. However, this is all academic to
real issue. How do I connect my Rails 3 app to a legacy database?
I think what you are looking for is something like DataMapper. It works
Rails 3 (when using the gem dm-rails) and is actively being
developed/supported. You can learn more here:
dm_rails information can be found on the datamapper.org site and at the
source code location.
They have tutorials on how to connect to legacy databases and lots of
information on working with some of the issues that come do that.