Ruby on Rails 3-Day BootCamp
Introductions Name Coding Experience What would you like to learn?
Curriculum RoR Toolset Rails Walk-Through Gems and Deployment Full Apps and Ruby inside Rails
Schedule Times Day 1 Day 2 Day3 9am - 10:30 Tools RubyToolBox BootStrap Break Scaffold and RailsApps and 10:45 - 12 Cucumber Views Hobo / Spree Lunch Routes and 1pm - 2:30 Devise Calculator Controllers Break Models and 2:45 - 4:30 I18N and Haml Translator Testing
Learning Goals Basic Rails Common Patterns and Practices Where to go for help
Learning Path Experimentation Test First Teaching Ask Questions Resources for finding answers
Structure Explanation (me talking) Demonstration (me typing) Experimentation (in-class coding) Questions
RoR Tools RVM / Pik / Jewelry Box / Rb.Env Git / Github / Heroku Sublime / Vi / RubyMine RubyGems / RubyToolbox Testing / RSpec / Cucumber Terminal / irb / Rails Console
RoR Resources RailsGuides - guides.rubyonrails.org Rails API - api.rubyonrails.org RubyDoc - ruby-doc.org RailsCasts - railscasts.com Github ReadMe Ruby ToolBox - www.ruby-toolbox.com
Ruby vs. Rails Ruby is the Language - developed 1993 Yukihiro Matsumoto “Matz” Rails is the Framework - developed 2004 David Heinemeier Hansson “DHH”
The Ruby Way Written in C Influenced by SmallTalk & Pearl Ruby is for People MINSWAN OSS (Open Source Software) RubyGems
The Rails Way Opinionated Software Convention over Configuration DRY (Don’t Repeat Yourself) TDD (Test Driven Development) Less Code, More Productivity
Tools Command Line Ruby / RubyGems Rails Source Control - Git IDE Deployment - Heroku
Command Line Command Prompt (CLI) Mac: Terminal, iTerm, etc... Unix: bash, zsh, csh, etc.... Windows: Command Prompt w/ Ruby on Rails
Ruby Ruby -v 1.9.2, 1.9.3, 2.0.0 (1.8.7) gem list Bundler, Rake, rubygems, etc...
RVM Ruby Version Manager Ruby Version Manager rvm list rvm use rvm gemset list rvm.io
Ruby Versions MRI, YARV, Standard Library, C-Ruby JRuby - Java Rubinius - Pure Ruby MagLev - SmallTalk MacRuby - Objective-C IronRuby - C# (for .Net)
Rails Rails -v 2.0-3, 3.0-2, 4.0
RVM Demo Gemset for Rails 4 rvm use --create 2.0.0@rails4 gem install rails --version 4.0.0.beta1 mkdir rvm_test cd rvm_test rvm --rvmrc --create
Git which git git --version
Git Source Control System Timeline, Track Changes Branching and Merging Code Safety
Git Commands git clone / init git status git add / rm git commit git push git log
Git Remotes GitHub - www.github.com Heroku - www.heroku.com
Git Help Git Site - git-scm.com Git Immersion - gitimmersion.com GitHub Help - help.github.com
Git Demo mkdir git_test cd git_test git init touch test_file.txt git status git add . git commit -m “add a file” git status
Git Demo cd .. git clone git_test/.git clone_test cd clone_test ls git remote -v touch clone.txt git commit -am “add another file”
Editor Sublime Text 2 / TextMate RubyMine KomodoEdit Eclipse Vi / Vim / Emacs
Sublime Text 2 Command line alias Win: doskey subl="C:Program FilesSublime Text 2sublime_text.exe" $* Mac: ln -s "/Applications/Sublime Text 2.app/Contents/SharedSupport/bin/subl" ~/bin/subl Linux: sudo ln -s /opt/SublimeText2/sublime_text /usr/bin/subl How to Open a folder
BREAK! 10-15 minutes
Rails New Rails App Modify the HomePage Scaffold MVC Layers
Create a New App rails Shows Options rails new <app_name> --options
Create a Class Management App Class Management App We want an app to manage Students, Classes, and Teachers rails new class_mngmt
The Application Directory The Root of our App: Rails root Entire App in one directory!
Run the App cd class_mngmt rails see rails commands rails server
Save a Baseline with git with git git init git add . git commit -m “add a bare rails app to track changes”
Modify the HomePage public/index.html public folder contains static content
Scaffolding rails generate see the generators rails g scaffold Student full_name age:integer bio:text title
MVC Response Controller Request Browser View Model Database
Shorten Bio Demo Shorten the bio on the view page Add a read more link
Helpers Presentation Logic Presenter Pattern Ruby Module - Included on all views Method Definitions Help generate html
View Exercise On the main Student page Change the Listing Students to Show only the Full Name and title Have the Full Name link to the view page Remove the view link
Lunch! 12pm - 1pm

Ruby on Rails 3 Day BC