Most of us have Rails 2 Application in our stash and it would be nice to support the latest Rails 3 since some day the Rails 2 methods and architecture will be deprecated.
Some of the useful reads are
Simon Carletti's Blog,
Rails Dispatch, and
omgbloglol.
So what you can do to upgrade an existing app is by running a (rails generate new app) on an existing Rails 2 application.
Say your previous Rails 2 app is in a folder titled "blogApp", then run
rails blogApp
It doesn't exactly forcefully overwrite the entire folder, but it prompts you if you wanna keep this particular file or if you wanna update it, and it also adds all the files that Rails 3 need like gemfile bundler, new rails.rb in the script folder, and so on.
Based on
omgbloglol, it would probably be a save bet to overwrite these files:-
Rakefile
README
config/boot.rb
-
public/404.html
(unless you’ve customized it) -
public/500.html
(unless you’ve customized it) -
public/javascripts/*
(if you don’t have a lot of version dependent custom JavaScript) -
script/*
(they probably wouldn’t work with the new Rails 3 stuff in their old form anyhow)
And depending on our needs, we might or might not wanna overwrite these :-
-
.gitignore
(unless you don’t really care; the new standard one is pretty good) app/helpers/application_helper.rb
config/routes.rb
config/environment.rb
-
config/environments/*
(unless you haven’t touched these as many people don’t) config/database.yml
-
doc/README_FOR_APP
(you do write this, don’t you?) test/test_helper.rb
By doing that, we pretty much have the boilerplate of a Rails 3 application and all we have to do is tweak the codes to conform to Rails 3.
- Moving gem to gemfile Bundler
- Moving the configurations from config/environment.rb to config/application.rb
- Routers new syntax
- etc..
And you can find the steps for the upgrade at
omgbloglol, which to me is pretty comprehensive.
Let the Rails 3 Migration begin.