SlideShare a Scribd company logo
Learning to Code for
Startup MVP


Presented by Henry Shi
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
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/
Prework - Git
Install git if not already included:
http://www.git-scm.com/book/en/Getting-
  Started-Installing-Git

Configure Git:
git config --global user.name "Your Name“
git config --global user.email
  your.email@example.com
Review of Last Session

1. The Web and How it Works

2. Git/Github

3. Rails and Ruby

4. Heroku
The Web - Overview
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
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
Heroku
What is Heroku?
•a hosted platform built specifically for
 deploying Rails and other web applications in
 1 command
•Best thing since sliced bread
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 ☺
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
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
Ruby - Numbers
• Self Explanatory
123.class     (123.0).class
>> Fixnum     >> Float




• Can add different types of numbers directly
Ruby - Symbols
• Characters (letters, digits, punctuation)
   preceded by colon (:)
food = :hello
:asf3fasdf.class
>> Symbol




• Lightweight strings
• immutable
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
ERROR: undefined
OFFENDING COMMAND: f‘~
STACK:

More Related Content

PPTX
Day 8 - jRuby
PPTX
Ruby, the language of devops
PPTX
Day 1 - Intro to Ruby
PPTX
Ruby and Security
PDF
Making CLI app in ruby
PPTX
Day 2 - Intro to Rails
PPTX
Day 9 - PostgreSQL Application Architecture
PDF
PureScript Tutorial 1
Day 8 - jRuby
Ruby, the language of devops
Day 1 - Intro to Ruby
Ruby and Security
Making CLI app in ruby
Day 2 - Intro to Rails
Day 9 - PostgreSQL Application Architecture
PureScript Tutorial 1

What's hot (20)

KEY
Ruby Midwest 2010 jRuby by Charles Nutter
PPTX
Microsoft Azure DocumentDB - Global Azure Bootcamp 2016
KEY
Why ruby and rails
PDF
NoSQL for great good [hanoi.rb talk]
PDF
[Start] Playing
PDF
Crystal
PDF
PharoDAYS 2015: On Relational Databases by Guille Polito
PDF
Enterprise messaging
PDF
CBDW2014 - Down the RabbitMQ hole with ColdFusion
PDF
Scala vs ruby
PDF
Ruby and Rails short motivation
PPTX
Functional Programming in PHP
KEY
Erlang: TL;DR
KEY
MVC Gems
PPTX
T4T Training day - NodeJS
PDF
Playing with playgrounds
PDF
A brief intro to RubyMotion
PPTX
.Net Fundamentals
PDF
Performance and Abstractions
PPT
Next generation frontend tooling
Ruby Midwest 2010 jRuby by Charles Nutter
Microsoft Azure DocumentDB - Global Azure Bootcamp 2016
Why ruby and rails
NoSQL for great good [hanoi.rb talk]
[Start] Playing
Crystal
PharoDAYS 2015: On Relational Databases by Guille Polito
Enterprise messaging
CBDW2014 - Down the RabbitMQ hole with ColdFusion
Scala vs ruby
Ruby and Rails short motivation
Functional Programming in PHP
Erlang: TL;DR
MVC Gems
T4T Training day - NodeJS
Playing with playgrounds
A brief intro to RubyMotion
.Net Fundamentals
Performance and Abstractions
Next generation frontend tooling
Ad

Similar to Code for Startup MVP (Ruby on Rails) Session 1 (20)

PDF
Basic Rails Training
PPT
Introduction To Rails
PPTX
Code for Startup MVP (Ruby on Rails) Session 2
PDF
americansyscorp b/o ascitconsultancyservices
PDF
Ruby on Rails for beginners
KEY
Supa fast Ruby + Rails
PPT
PPTX
Rubyonrails 120409061835-phpapp02
PDF
Introduction to rails
PPTX
Dev streams2
PDF
Install Ruby on Rails Like a Pro: Effortless Guide
KEY
An introduction to Rails 3
KEY
Intro to Ruby on Rails
PPTX
Ruby on Rails - An overview
PPT
PDF
Building Application With Ruby On Rails Framework
PDF
Ruby Rails Web Development.pdf
PPT
Intro To Ror
KEY
Ruby on Rails survival guide of an aged Java developer
PPT
Rapid Application Development using Ruby on Rails
Basic Rails Training
Introduction To Rails
Code for Startup MVP (Ruby on Rails) Session 2
americansyscorp b/o ascitconsultancyservices
Ruby on Rails for beginners
Supa fast Ruby + Rails
Rubyonrails 120409061835-phpapp02
Introduction to rails
Dev streams2
Install Ruby on Rails Like a Pro: Effortless Guide
An introduction to Rails 3
Intro to Ruby on Rails
Ruby on Rails - An overview
Building Application With Ruby On Rails Framework
Ruby Rails Web Development.pdf
Intro To Ror
Ruby on Rails survival guide of an aged Java developer
Rapid Application Development using Ruby on Rails
Ad

Code for Startup MVP (Ruby on Rails) Session 1

  • 1. Learning to Code for Startup MVP Presented by Henry Shi
  • 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/
  • 4. Prework - Git Install git if not already included: http://www.git-scm.com/book/en/Getting- Started-Installing-Git Configure Git: git config --global user.name "Your Name“ git config --global user.email your.email@example.com
  • 5. Review of Last Session 1. The Web and How it Works 2. Git/Github 3. Rails and Ruby 4. Heroku
  • 6. The Web - Overview
  • 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
  • 14. Ruby - Symbols • Characters (letters, digits, punctuation) preceded by colon (:) food = :hello :asf3fasdf.class >> Symbol • Lightweight strings • immutable
  • 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