Sunday, February 7, 2010

Rails 3 beta: First impressions on a new app

Initial application creation
Initial application creation is as easy as it has always been. The output is formatted a little better and you can create an app with a path instead of just a subdirectory name. A .gitignore file is created automatically as well as a few .gitkeep files on directories that don't start out with files in them, a really nice touch for those of us who use git.


script/* replaced by script/rails
This takes a little getting used to if you are used to the old script commands. Stuff like "script/console" doesn't work any more, it has been replaced by "rails console" or "rails c" if you prefer the shorthand version. "rails --help" will be your friend until you get used to the new commands.


Generators
The new generator system seems to be very well thought out and has all kinds of great new features if you want to modify templates or write your own generators. Even if you are just running the default generators things have improved a bit. The default templates have improved, for example div tags instead of p tags and use of a form partial instead of duplicating code in the edit and new views.

Testing
Testing out of the box does not seem to have changed much. The main thing I noticed is that most of the major testing tools are not yet working with the rails 3 beta. I tried out shoulda, rspec, and cucumber all without success.

3 comments:

fmagsipoc said...

great opportunity to relearn testing w/o the plugins we learned to depend on... well in my case at least :p

William T said...

Rspec has been updated for Rails 3, you just have to install the prerelease gem.

Nathan said...

I will have to try rspec again then. Shoulda seems to have a rails 3 branch going now, I have not had a chance to try it out.