2. Agenda – Wednesday November 7
1. Review of Last Session
2. Ruby Basics
o Syntax and semantics
o Practice makes perfect
1. Rails Models (but no Bottles)
o ORM and SQL introduction
o Migrations
o Making the User model
o Signup/Signin/Signout
3. Prework – Setup
• Windows (not recommended if possible):
o http://railsinstaller.org/
o Use Sublime Text for your text editor
• OSX:
o http://railsinstaller.org/
o This includes osx-gcc-installer (200mb)
• Linux:
o http://blog.sudobits.com/2012/05/02/how-to-install-
ruby-on-rails-in-ubuntu-12-04-lts/
7. GIT/GITHUB
• What is GIT?
• Distributed Version Control System (DVCS)
• Why should I care?
o Never lose data or accidentally overwrite, delete files
o Collaborate with peers anywhere and stay in sync
automatically (no more _v1, _v2, _final, _final_final…)
o Compare and track changes over time, and easily
revert changes
o Deploy code to real web
8. Rails
• Ruby on Rails is an open-source web
framework that’s optimized for programmer
happiness and sustainable productivity.
• It lets you write beautiful code by favoring
convention over configuration.
• 80/20 Rule =>great for Startup MVP
9. Heroku
What is Heroku?
•a hosted platform built specifically for
deploying Rails and other web applications in
1 command
•Best thing since sliced bread
10. Ruby – Programmer’s Best Friend
• Ruby is a dynamic, open source
programming language with a focus on
simplicity and productivity. It has an
elegant syntax that is natural to read and
easy to write.
• We will only cover the necessary syntax
needed to create a rails app
• Thankfully, its not a lot ☺
11. Interactive Ruby Shell
• For the following slides, you should follow
along with the Interactive Ruby Shell (irb)
• Open a terminal, type irb and press enter
12. Ruby - Strings
• Characters (letters, digits, punctuation)
surrounded by quotes
food = "chunky bacon"
puts "I'm hungry for, #{food}!"
>> "I'm hungry for, chunky bacon!"
• Can perform operations on strings,
concatenation, length, empty, etc
“Hello” + “World”
>> “Hello World"
“Henry”.empty?
>> false
13. Ruby - Numbers
• Self Explanatory
123.class (123.0).class
>> Fixnum >> Float
• Can add different types of numbers directly
15. Ruby - Array
• List surrounded by square brace and
separated by commas, zero indexed
a = [1, 2, 3]
b = ('a'..'e').to_a # ["a", "b", "c", "d", "e"]
c = %w[foo bar baz quux] # ["foo", "bar", "baz", "quux"]
• Can perform operations on arrays, add,
remove, reverse etc