Learn Ruby on Rails
For
Web Development
By: John Elder
Codemy.com
Learn Ruby on Rails For Web Development
By: John Elder Published By Codemy.com
Chicago, IL USA
ISBN:978-0-692-36421-5
First Edition
Copyright John Elder and Codemy.com
http://www.Codemy.com
TABLE OF CONTENTS
ABOUT THE AUTHORJohn Elder is a Web Developer, Entrepreneur, and Author living in Chicago, IL. He created one of the earliest online advertising networks in the late nineties and sold it to publicly traded WebQuest International Inc at the height of the first dot-com boom.
He went on to develop one of the Internet's first Search Engine Optimization tools, the Submission-Spider that was used by over three million individuals, small businesses, and governments in over forty-two countries.
These days John does freelance web development work, writes about Programming, Growth Hacking, and Internet Advertising, and runs Codemy.com the online school that teaches coding, Internet Marketing, and entrepreneurship to thousands of students.
John graduated with honors from Washington University in St. Louis with a degree in Economics. He can be reached at john@codemy.com
INTRODUCTION"Rails? What a bloated waste of time...I'll NEVER use it for anything...ever."
That was really the first thought I had about Rails when I first looked into using it almost a decade ago. I'm an old school PHP guy who always built websites by simply punching out HTML and PHP onto Windows Notepad by hand, saving the file and uploading it to my regular apache web server using basic FTP software.
Compared to that, Rails seemed like a massive and unnecessary sort of thing. Who needs a whole big framework just to build a simple website?
And talk about complicated! The first time I tried to install Rails, I gave up in complete frustration after about an hour and a half.
Compared to hand-coding some HTML and PHP on notepad and then FTP'ing it up to my server, this Rails thing seemed borderline insane! In fact, it wasn't till recently that I even bothered to check out Rails again, and I'm glad I did because once you get past the insanity that is Rails installation...Rails is a dream to use!
It's just...fun!
You can do so much with Rails, so quickly, that it makes anything else seem crazy by comparison...even basic PHP.
It's true, there's a bit of a learning curve...in fact, it's unnecessarily hard to get started using Rails in the beginning unless you have someone to guide you through it (that's where this book comes into play). But once you get past a few initial rough patches, Rails is really quite easy...and I've been there so I can ease you through those initial bumps along the way.
In fact, I think you'll be surprised just how quickly you'll be building apps...
SO WHAT EXACTLY IS RUBY ON RAILS?Ruby on Rails is an open source web development framework written in the Ruby programming language that makes creating apps and websites incredibly easy.
It uses something called a model/view/controller architecture that does a lot of the dirty work of dealing with databases and things like that for you, allowing you to focus on what's important to develop your app with speed and ease.
It was created by David Heinemeier Hansson back around 2004 - 2005 ish and quickly became one of the most popular app frameworks in the world. Many popular sites use it, including Groupon, Indiegogo, Airbnb, Yammer, SoundCloud, Scribd, Shopify, Hulu and many many others. Twitter was initially developed using Rails. Yep.
WHO IS THIS BOOK FOR?This book is for the absolute Rails beginner. You don't need to have any prior experience with Rails whatsoever. It'll be helpful if you have some web development experience of some sort (a basic understanding of HTML is a plus, Javascript is a plus too) but you certainly don't need to know anything at all to get started with this book.
I'll walk you through absolutely everything you need to know step by step.
DO YOU NEED TO LEARN THE RUBY PROGRAMMING LANGUAGE?The first thing that most people tend to ask me is whether or not you need to learn the Ruby programming language to use Rails. Though it is called Ruby on Rails, you don't really need to know Ruby to start using Rails to develop web apps.
We'll be using some simple embedded Ruby along the way (embedded Ruby is just Ruby that's used on a web page...embedded on a web page), but it'll be very basic Ruby and I'll walk you through it.
If you have any experience with other programming languages, you'll be able to pick up Ruby pretty easily. There are lots of free resources online that will teach you the basics. In fact, I'm finishing up a book on basic Ruby at the moment that you can check out if you're interested in learning more.
WHAT WILL WE MAKE IN THIS BOOK?No one wants to read boring dry instructions. That's a fairly terrible way to learn anything! Instead we'll spend most of this book actually building an app from start to finish.
In this case, we'll be building a clone of Pinterest. Why Pinterest? Lots of reasons, really. Pinterest is one of the most popular websites on the Internet, it'll allow us cover a broad range of topics that you'll be able to use forever in whatever app/website that you work on in the future. It'll teach us how to create users, log them in and out of our app, allow them to upload text and images to a database, and then stylize all that stuff onto a webpage using some neat effects.
Plus, I think you'll discover that building Pinterest is pretty easy! Hopefully that realization will give you the confidence to strike out and build your own cool stuff. If a site like Pinterest is this easy to create, well, you can probably build just about anything!
HOW DO YOU LEARN?Some people learn best by reading, others learn by watching or listening...still others learn by using their hands and actually do-ing things. It's my goal to tick as many of those boxes as possible to give you the tools you need to really learn Rails quickly and easily in whatever method of learning works best for you.
So in addition to this book, I've also created an online video course that follows along with the book. You can actually watch me complete each of the steps in the book and build our clone of Pinterest right in front of your eyes.
You can ask me questions online if you get stuck along the way, hang out with everyone else who's enrolled in the course on the course message board, and copy and paste all the code snippets from this book.
The video course is hosted at the online code school, Codemy.com and you can follow along and watch at your own pace.
We've got a lot of different courses besides this rails course. If you're interested in learning Internet Marketing, Web Development, or how to build an online Startup I highly recommend you check Codemy.com out. People are actually raving about it, which is pretty cool!
Full Membership gets you access to all the courses for just $497, or you can sign up for individual video courses (like this Rails course) for just $97 each.
As a thank you for reading this book, I'd like to offer you $22 off the Rails course. Just use coupon code amazon when you order from:
http://www.Codemy.com/rails/CONVENTIONS USED THROUGHOUT THE BOOKThis is a book about computer programming, so the layout is a little bit different than your average work of fiction (or non-fiction for that matter).
First let's talk terminology.
I won't use a lot of weird technical terms...and if I do I'll be sure to explain them.
One thing I want to mention is my use of the term 'app'. Most people use the phrase 'app' when talking about anything made online these days, and especially anything created using Rails.