Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.

Code for Startup MVP (Ruby on Rails) Session 1

654 views

Published on

  • Be the first to comment

Code for Startup MVP (Ruby on Rails) Session 1

  1. 1. Learning to Code forStartup MVPPresented by Henry Shi
  2. 2. Agenda – Wednesday November 71. Review of Last Session2. Ruby Basics o Syntax and semantics o Practice makes perfect1. Rails Models (but no Bottles) o ORM and SQL introduction o Migrations o Making the User model o Signup/Signin/Signout
  3. 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. 4. Prework - GitInstall git if not already included:http://www.git-scm.com/book/en/Getting- Started-Installing-GitConfigure Git:git config --global user.name "Your Name“git config --global user.email your.email@example.com
  5. 5. Review of Last Session1. The Web and How it Works2. Git/Github3. Rails and Ruby4. Heroku
  6. 6. The Web - Overview
  7. 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. 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. 9. HerokuWhat is Heroku?•a hosted platform built specifically for deploying Rails and other web applications in 1 command•Best thing since sliced bread
  10. 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. 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. 12. Ruby - Strings• Characters (letters, digits, punctuation) surrounded by quotesfood = "chunky bacon"puts "Im hungry for, #{food}!">> "Im hungry for, chunky bacon!"• Can perform operations on strings, concatenation, length, empty, etc “Hello” + “World” >> “Hello World" “Henry”.empty? >> false
  13. 13. Ruby - Numbers• Self Explanatory123.class (123.0).class>> Fixnum >> Float• Can add different types of numbers directly
  14. 14. Ruby - Symbols• Characters (letters, digits, punctuation) preceded by colon (:)food = :hello:asf3fasdf.class>> Symbol• Lightweight strings• immutable
  15. 15. Ruby - Array• List surrounded by square brace and separated by commas, zero indexeda = [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
  16. 16. ERROR: undefinedOFFENDING COMMAND: f‘~STACK:

×