Archive for March, 2009

useful rails command-line tasks

Tuesday, March 31st, 2009

Use mysql as the database rather than sqlite:

>rails newproj -d mysql

Create migration with new field to existing table:

>script/generate add_fieldname_to_tablename fieldname:fieldtype

Generate a scaffold for an existing class and table

>script/generate scaffold ClassName fieldname:fieldtype --skip-migration

See routes:

>rake routes

See all rake tasks:

>rake -T

Migrate specific database:

>rake db:migrate RAILS_ENV=production

Migrate database to specific version:

>rake db:migrate VERSION=2

Migrate to second-to-last version:

>rake db:rollback

I was browsing through some photos from our Canada trip, and…

Monday, March 16th, 2009

Canada Picture

I was browsing through some photos from our Canada trip, and found this one.  I think I like it mostly because of the oncoming headlights.