Learn Ruby on Rails - Kick Off
The main aspect of this post is to guide the beginner who has no experience in Ruby/Rails, but wants to enter the magical world of Ruby on Rails. I'll try to guide you from the scratch and gradually introduce you about various Rails features (probably from the next posts). So, lets start.... ...
The main aspect of this post is to guide the beginner who has no experience in Ruby/Rails, but wants to enter the magical world of Ruby on Rails. I'll try to guide you from the scratch and gradually introduce you about various Rails features (probably from the next posts). So, lets start....
The first thing we need to know is what is Ruby and what is Rails.
Ruby: Ruby is a programming language. It was created 20 years ago by Yukihiro “Matz” Matsumoto.
Rails: Rails is a framework for building websites. Rails combines the Ruby programming language with HTML, CSS, and JavaScript to create a web application that runs on a web server. It also known as Ruby on Rails.
So for learning and understanding Rails we must learn the basic structure, syntax and features of Ruby language. And if you have no knowledge about the Ruby you should start by learning basic Ruby. Its very easy and flexible.
Learning Ruby
Now to learn Ruby, there are plenty of resources and books in the web. You can start with the ruby book: https://raw.githubusercontent.com/jay3126/various_imp_ebooks/master/the_ruby_programming_language.pdf
If you go through Chapter-3 to Chapter-7. I think its enough for now.
You can also check Tutorials-Point: http://www.tutorialspoint.com/ruby/ It will give you a quick and easy view about this language.
You can follow any resource you want but make sure you have these knowledge and abilities before you move to Rails:
- you know about ruby variables and basic operations
- you know the differences between Instance, class, local variable. (very important)
- you can write if..else and loops in Ruby
- you can do basic string operations
- you know how to write a method and return a value
- you can define class, create object and call methods.(very important)
- you know how to define Array-Hashes and how to play with them. (important)
- you have little idea about ranges and iterator.
- and you heard the name of meta-programming. (It seems difficult at first time but its important. you can skip it for now and can learn it later)
So if you already know about these stuffs ( Congratulations ), I think u can now move to Rails part.
Learning Rails
The latest version of Rails is now (4.2). And to start learning Rails-4 from the scratch I think the best book in the market is:
Ruby on Rails Tutorial: Learn Web Development with Rails by Michael Hartl
And you can start just from the first chapter: https://www.railstutorial.org/book/beginning
This book is designed such a way that you will travel from the zero level to the advanced level with each chapter. As a beginner, at first you may find it hard to understand the Rails MVC structure and Naming Conventions. But don't worry, you will understand more when you start the first project on your own. And then this book will act as a guidebook for you.
So just relax and enjoy the book....
- Chapter 1, 2: Just read it to understand the basic.
- Chapter 3, 5, 6: Try to understand these lessons. Its important.
- Chapter 4: It explains some Ruby syntax and build-in function. Give it a look.
- Chapter 7, 8, 9: It explains how Models, Controller and Views work with each other to make a working app. Try do understand.
- Chapter 11: It explains how to make One-to-Many relation with another model. Try to understand it. I will explain Rails association later.
- Chapter 10, 12: If you are not a super Nerd and a normal human like me.. then you'll not understand anything in the first reading. Just read this chapters relaxly and you will understand these stuffs gradually. It will be more clear later when you'll gain a little more experience.
So, Don't worry.... keep calm and stick with Rails. It needs a little time to catch the magic of Rails.
I will try to explain the Rails MVC structure, Naming Convention and variable passing techniques in the next post.
Happy Coding !