more info

Media72 Hosting Articles and Tips

Archive for January, 2008

Learning Ruby on Rails Fundamentals Without Reading

Wednesday, January 9th, 2008

For all those people, like me, who would rather listen or watch something than read there is now the perfect way to learn Ruby on Rails. Building Web Apps has a new podcast called Learning Rails by Michael Slater and Chris Haupt. It starts at the very beginning teaching you the most basic things about Rails so is perfect for anyone that has no prior Rails experience. They have only got to episode 4 so far but I would assume they will keep going and progress to more advanced topics as time goes on, they say there will be a new episode every 2 weeks. The podcast focuses on the concepts behind Ruby on Rails rather than trying to tech coding. I highly recommend the podcast to anyone new to rails.

6 things to try in Rails this year

Wednesday, January 9th, 2008

It seems that blog posts in the first couple of weeks of the new year (happy new year by the way) follow the “x things to do this year” meme as a virtual homage to new years resolutions. Never one to buck a trend, I have prepared this short list of things you should try in Ruby and in Rails - I hope to cover each topic in more detail over the next couple of weeks.

  1. Install Rails: This is aimed at those of you out there that haven’t tried Ruby on Rails yet. Jump in - have a go, there are plenty of resources out there, and it is fairly easy to install regardless of your platform
  2. Upgrade to Rails 2.0: I have covered what’s new in Rails 2.0 in a number of my previous posts, and upgrading isn’t really THAT difficult if you follow the steps and fix any deprecation notices.
  3. Write a plugin: Plugins allow you to re-use common patterns without having to resort to the dreaded cut-and-paste keys. Rails has a built in plugin generator that gives you the skeleton code, all you need to do is to mix-in the right modules - oh, and write the code…
  4. Try out RESTful routes: RESTful Rails have been around for a while now, but many of the tutorials around the net are still CRUD based, so if you are a Rails beginner, you might not have tried them out yet.
  5. Use Ruby as your scripting language: Because Rails does such an excellent job of doing the hard work, it is very likely that you have never had to manually connect to a database or read the contents of a directory or performed other mundane tasks in Ruby. If you have to do any scripting, instead of PERL or Python, use Ruby - it will help you better understand the nuances of the language.
  6. Refactor your code the Ruby way: If you have come from other C-like languages (such as PHP or Java) you would
    be used to the idioms from that style of coding. Try refactoring your code to use blocks instead of for loops, or using inline if statements - you can squeeze a lot into one line in Ruby, see how far you can push it. Again, this is a great exercise to learn the language.

Go on, try them out - the new year is a great time to try something new!

This article provided by