When I was first learning rails I found one thing which helped immensely:

script/console

It’s the bees knees..

  • when you’re starting out it’s like a safe ruby boxing ring where you can spar without getting your butt whooped,
  • as you get a bit better you can practise new moves, and get some essential dojo in,
  • once you know your stuff you can try out some severely funky moves without having to refresh the browser every few seconds,
  • you can always nip into console and get your db sorted, check on db state, sessions, tidy some things up, interrogate your models and find faults, and perfect new bits of code.

I do all my practising, and probably a fair bit of debugging in script/console – if I’m ever doing anything new, or have a new idea it’s the first place I go.

If something’s gone screwy with my app, it’s the first place I go, and when I was starting out – it was ALWAYS open on my desktop.

I’ve written this up because I was just on irc, and for the umpteemth time spreading the word about script/console. Really, go discipline yourself.. Amy Hoy said it far better than this over on slash 7, go check it out:

http://slash7.com/articles/2006/12/21/secrets-of-the-rails-console-ninjas