Going to Rails 3 Cheat Sheet

Basic cheat sheet for me to help remember the new syntax of Rails 3. Check out the rubyonrails.org guide and also Rails 3 Upgrade Handbook

Rails 2 Rails 3 about
script/console rails console On the command line, all scripts are now run with the “rails” command. Just leave off “script/” and type rails – instead
RAILS_ROOT Rails.root.to_s When referring to the RAILS_ROOT (the root directory of your project), this is the new way to refer to it.
RAILS_ENV Rails.env
annotate rake db:annotate POSITION=’top’

Note you will want to use the “annotate_model” plug-in instead of the “annotate” gem. To get it up and running in your app, try: rails plugin install https://github.com/alsemyonov/annotate_models.git

Leave a Reply

Your email address will not be published. Required fields are marked *

Previous post After upgrading to 10.6.5, can’t run sudo apachectl restart
Next post Ruby each, collect, map, select, reject, and inject