Ruby on Rails for Beginners

Alright, so we have PHP, Ajax… what is this Ruby on Rails? What is Ruby and why is it on Rails? These are some of the questions which I wanted answers to a while ago. I was trying to learn Ruby and Ruby on Rails because it was the buzzword and was touted as being really “awesome”.

Well Ruby is a programming language inspired by Perl and with some of the features of Smalltalk – a really old language. It was designed and developed by Yukihiro Matsumoto. It is a very object-oriented lanaguage. It can be called soemwhat similar to Python as well. You can read the Wikipedia article for some Semantic definition and it’s origins but stop there. There are better pages regarding the language.

Learning Ruby

Learning Ruby is fairly easy for any programmer. It is different from PHP or C++ if you think of it. The best place to start Ruby is from its website. The following resources are the best I’ve found so far:

  • Try Ruby – This website has a Ruby shell, along with a tutorial. It will show you the basics of the language and you will get to learn how Ruby works. It’s quite different from PHP/Perl.
  • Comparing Ruby To Other Languages – If you’re coming from C/C++, Java, Perl, PHP & Python. This will show you the differences. There isn’t much there but you will get the idea.
  • WhyTheLuckyStiff – This one’s a fun guide to Ruby. It also teaches you how to program, so it may seem quite boring to you.

Some of the advantages of Ruby are:

  1. Everything within Ruby is treated as an Object. Everything within Ruby has a set of properties and attributes. For example I could write “5.times { print “Hello World\n”; }” or “five.times { print “Hello World\n”;}; and it will print the string five times. (Example borrowed from Ruby’s website)
  2. Because of #1 you can mess around with the language as much as you want to overload definitions, create new methods. It rocks for this reason.
  3. The language is extremely flexible and dynamic – for the above reasons.

More language specific details are here.

What the hell is Rails?

Well Rails is an open-source web framework for Ruby. Ruby, on Rails feels like a programming language on steroids. It makes it so powerful, it should be illegal (that’s what I feel). With RoR you can program and create applications really quickly and with a minimum amount of programming. Don’t beleive me? View this screencast which shows the RoR team creating a weblog in 15 minutes and writing about 50 lines of code. Truly amazing.

Here are some tutorials to get you on your way to start using Ruby on Rails. You may only want todo this after you’ve learnt something about programming Ruby.

  • top 10 ruby on rails tutorials – probably the best of them all, a lot of links to tutorials which should jump start you on rails as well.
  • O-reilly.com lamp – This is a o’reilly associated website where Curt hibbs takes you from beginning to the end in setting up a recipe cookbook. This is a very handy tutorial and takes you through the basics of setting up a database, server and shows you the basics of the Rails framework (componenents, helpers, models etc).
    There’s also a part two of this tutorial. They are slightly outdated, but still extremely useful to learn Ror.
  • Weblog screencast – this screencast gets you going pretty well as well. its got audio explanations if you think you need them. They’re done on a mac.
  • Four days on rails – this is a website which has a tutorial which can probably answer some programmer’s questions.
  • top 10 tips of rails beginners – some friendly advice which i found useful when i was working with ror. i wish i had paid more attention there.
  • another rails application tutorial an addressbook – if you think a cookbook or weblog is too similar or not common and you want a different tutorial – this one gives you an addressbook.

The RoR tutorials mentioned above use the server given by the Rails framework, called WeBrick and uses a mySQL server. To use apache with mysql you can try a solution called Instant Rails. It’s pretty darn nice. Also the tutorials require some database manipulation so it would be useful if you have a interface to mysql like PhpMyAdmin installed. You will need PHP installed for it. Download Ruby, Rails etc from here.

A final word, this information may seem similar to what is there on wikipedia or on official websites. This is basically my output from tons of research and running tutorials. What i’ve written is the best of the crop. I could give you different but it wouldn’t be the best.

Hope you have fun and learn something. Questions, leave them below in the comments and I’ll help out as much as I can.

Tags: , , ,

5 comments

  1. Thanks for the info <3 Saved me a LOT of extra reading ;)

  2. Nice work, you’ve given a good overview of Rails for beginners.

  3. Thanks for the information!

  4. Srushti Makhija · ·

    It was precise and really best for beginners..

  5. Thank you for the auspicious writeup. It in fact was a amusement account it.
    Look advanced to more added agreeable from you! However, how can we
    communicate?