Friday, May 8, 2009

Awesome: Working with the Rails console and all the tricks

by Sandip Ransing 1 comments
Tags

Testing your active record methods using script/console

If you are using windows, you start the console by using this command:

ruby script\console
Linux:

./script/console

Just use the following command whenever you make changes to your model objects:

reload!

Instead of accessing your MySQL database with

mysql -u -p

You can instead do

script/dbconsole

and if you database has a password, just do

script/dbconsole -p


% script/dbconsole # connect to development database (or $RAILS_ENV)
% script/dbconsole production # connect to production database


Cheers !

$@ndip

blog comments powered by Disqus

About The Author

Sandip is a ruby on rails developer based in pune and also a blogger at funonrails. Opensource contributor and working with Josh software Private Limited. for more info read Follow Sandip on Twitter for updates.

Connect With Me...

Github Projects

@sandipransing Twitter