Using schema.rb, I think we can actually convert an older Rails 3.0 project to a Rails 3.2.3 project, rebuilding the database using this schema.rb file.
But if I just used scaffolds to create all the RESTful resources before in the 3.0 project, then won’t the scaffolds need to be generated once again for this new Rails 3.2.3 project also? If that is the case, won’t it be not useful to use scheme.rb? Because we will create all the migration files along the way anyway and do the rake, and we can just generate the extra create index migrations along the way.
Or is there a better way? Such as a way that the old scaffolds and old database tables and indexes can be recreated automatically? The old database can be used or discarded, so it is a cleaner option to start the sqlite database fresh from the start.
Is there a reason you want to scrap the existing project/database to build a new one? It’s usually pretty easy to just update the rails version in your Gemfile, run bundle install, and then just fix anything that breaks (which, if you were using the default scaffolding, won’t be much). The existing database will work just fine with either 3.0 or 3.2, as well as all of your old scaffolding files.
You should check out this railscast to see how to go from rails 3.0 to 3.1, so you can see the basics of upgrading. Upgrading from 3.1 to 3.2 is even easier.
To answer your original question, there is no straightforward way to regenerate scaffolds using schema.rb. The scaffolds are only a starting point to help you as you start to build a model/controller, there would usually be no point in recreating them since you usually end up modifying them heavily afterwards anyway.