Download - Ruby on Rails 3 Day BC
![Page 1: Ruby on Rails 3 Day BC](https://reader033.vdocument.in/reader033/viewer/2022061104/5404497a8d7f72a1768b4697/html5/thumbnails/1.jpg)
Ruby on Rails3-Day BootCamp
![Page 2: Ruby on Rails 3 Day BC](https://reader033.vdocument.in/reader033/viewer/2022061104/5404497a8d7f72a1768b4697/html5/thumbnails/2.jpg)
Introductions
Name Coding Experience What would you like to learn?
![Page 3: Ruby on Rails 3 Day BC](https://reader033.vdocument.in/reader033/viewer/2022061104/5404497a8d7f72a1768b4697/html5/thumbnails/3.jpg)
Curriculum
RoR ToolsetRails Walk-ThroughGems and DeploymentFull Apps and Ruby inside Rails
![Page 4: Ruby on Rails 3 Day BC](https://reader033.vdocument.in/reader033/viewer/2022061104/5404497a8d7f72a1768b4697/html5/thumbnails/4.jpg)
ScheduleTimes Day 1 Day 2 Day3
9am - 10:30 Tools RubyToolBox BootStrap Break
10:45 - 12 Scaffold and Views Cucumber RailsApps and
Hobo / SpreeLunch
1pm - 2:30 Routes and Controllers Devise Calculator
Break
2:45 - 4:30 Models and Testing I18N and Haml Translator
![Page 5: Ruby on Rails 3 Day BC](https://reader033.vdocument.in/reader033/viewer/2022061104/5404497a8d7f72a1768b4697/html5/thumbnails/5.jpg)
Learning Goals
Basic RailsCommon Patterns and PracticesWhere to go for help
![Page 6: Ruby on Rails 3 Day BC](https://reader033.vdocument.in/reader033/viewer/2022061104/5404497a8d7f72a1768b4697/html5/thumbnails/6.jpg)
Learning Path
ExperimentationTest First TeachingAsk QuestionsResources for finding answers
![Page 7: Ruby on Rails 3 Day BC](https://reader033.vdocument.in/reader033/viewer/2022061104/5404497a8d7f72a1768b4697/html5/thumbnails/7.jpg)
Structure
Explanation (me talking)Demonstration (me typing)Experimentation (in-class coding)Questions
![Page 8: Ruby on Rails 3 Day BC](https://reader033.vdocument.in/reader033/viewer/2022061104/5404497a8d7f72a1768b4697/html5/thumbnails/8.jpg)
RoR ToolsRVM / Pik / Jewelry Box / Rb.EnvGit / Github / HerokuSublime / Vi / RubyMineRubyGems / RubyToolboxTesting / RSpec / CucumberTerminal / irb / Rails Console
![Page 9: Ruby on Rails 3 Day BC](https://reader033.vdocument.in/reader033/viewer/2022061104/5404497a8d7f72a1768b4697/html5/thumbnails/9.jpg)
RoR ResourcesRailsGuides - guides.rubyonrails.orgRails API - api.rubyonrails.orgRubyDoc - ruby-doc.orgRailsCasts - railscasts.comGithub ReadMeRuby ToolBox - www.ruby-toolbox.com
![Page 10: Ruby on Rails 3 Day BC](https://reader033.vdocument.in/reader033/viewer/2022061104/5404497a8d7f72a1768b4697/html5/thumbnails/10.jpg)
Ruby vs. RailsRuby is the Language -
developed 1993 Yukihiro Matsumoto “Matz”
Rails is the Framework - developed 2004 David Heinemeier Hansson “DHH”
![Page 11: Ruby on Rails 3 Day BC](https://reader033.vdocument.in/reader033/viewer/2022061104/5404497a8d7f72a1768b4697/html5/thumbnails/11.jpg)
The Ruby Way Written in CInfluenced by SmallTalk & PearlRuby is for PeopleMINSWANOSS (Open Source Software)RubyGems
![Page 12: Ruby on Rails 3 Day BC](https://reader033.vdocument.in/reader033/viewer/2022061104/5404497a8d7f72a1768b4697/html5/thumbnails/12.jpg)
The Rails Way
Opinionated SoftwareConvention over ConfigurationDRY (Don’t Repeat Yourself)TDD (Test Driven Development)Less Code, More Productivity
![Page 13: Ruby on Rails 3 Day BC](https://reader033.vdocument.in/reader033/viewer/2022061104/5404497a8d7f72a1768b4697/html5/thumbnails/13.jpg)
ToolsCommand LineRuby / RubyGemsRailsSource Control - GitIDEDeployment - Heroku
![Page 14: Ruby on Rails 3 Day BC](https://reader033.vdocument.in/reader033/viewer/2022061104/5404497a8d7f72a1768b4697/html5/thumbnails/14.jpg)
Command Line
Command Prompt (CLI)Mac: Terminal, iTerm, etc...Unix: bash, zsh, csh, etc....Windows: Command Prompt w/ Ruby on Rails
![Page 15: Ruby on Rails 3 Day BC](https://reader033.vdocument.in/reader033/viewer/2022061104/5404497a8d7f72a1768b4697/html5/thumbnails/15.jpg)
Ruby
Ruby -v1.9.2, 1.9.3, 2.0.0 (1.8.7)
gem listBundler, Rake, rubygems, etc...
![Page 16: Ruby on Rails 3 Day BC](https://reader033.vdocument.in/reader033/viewer/2022061104/5404497a8d7f72a1768b4697/html5/thumbnails/16.jpg)
RVMRuby Version Manager
rvm listrvm uservm gemset list
rvm.io
![Page 17: Ruby on Rails 3 Day BC](https://reader033.vdocument.in/reader033/viewer/2022061104/5404497a8d7f72a1768b4697/html5/thumbnails/17.jpg)
Ruby VersionsMRI, YARV, Standard Library, C-RubyJRuby - JavaRubinius - Pure RubyMagLev - SmallTalkMacRuby - Objective-CIronRuby - C# (for .Net)
![Page 18: Ruby on Rails 3 Day BC](https://reader033.vdocument.in/reader033/viewer/2022061104/5404497a8d7f72a1768b4697/html5/thumbnails/18.jpg)
Rails
Rails -v2.0-3, 3.0-2, 4.0
![Page 19: Ruby on Rails 3 Day BC](https://reader033.vdocument.in/reader033/viewer/2022061104/5404497a8d7f72a1768b4697/html5/thumbnails/19.jpg)
RVM DemoGemset for Rails 4
rvm use --create 2.0.0@rails4gem install rails --version 4.0.0.beta1 mkdir rvm_testcd rvm_testrvm --rvmrc --create
![Page 20: Ruby on Rails 3 Day BC](https://reader033.vdocument.in/reader033/viewer/2022061104/5404497a8d7f72a1768b4697/html5/thumbnails/20.jpg)
Git
which gitgit --version
![Page 21: Ruby on Rails 3 Day BC](https://reader033.vdocument.in/reader033/viewer/2022061104/5404497a8d7f72a1768b4697/html5/thumbnails/21.jpg)
Git
Source Control SystemTimeline, Track ChangesBranching and MergingCode Safety
![Page 22: Ruby on Rails 3 Day BC](https://reader033.vdocument.in/reader033/viewer/2022061104/5404497a8d7f72a1768b4697/html5/thumbnails/22.jpg)
Git Commandsgit clone / initgit statusgit add / rmgit commitgit pushgit log
![Page 23: Ruby on Rails 3 Day BC](https://reader033.vdocument.in/reader033/viewer/2022061104/5404497a8d7f72a1768b4697/html5/thumbnails/23.jpg)
Git Remotes
GitHub - www.github.comHeroku - www.heroku.com
![Page 24: Ruby on Rails 3 Day BC](https://reader033.vdocument.in/reader033/viewer/2022061104/5404497a8d7f72a1768b4697/html5/thumbnails/24.jpg)
Git Help
Git Site - git-scm.comGit Immersion - gitimmersion.comGitHub Help - help.github.com
![Page 25: Ruby on Rails 3 Day BC](https://reader033.vdocument.in/reader033/viewer/2022061104/5404497a8d7f72a1768b4697/html5/thumbnails/25.jpg)
Git Demomkdir git_testcd git_testgit inittouch test_file.txtgit statusgit add .git commit -m “add a file”git status
![Page 26: Ruby on Rails 3 Day BC](https://reader033.vdocument.in/reader033/viewer/2022061104/5404497a8d7f72a1768b4697/html5/thumbnails/26.jpg)
Git Democd ..git clone git_test/.git clone_testcd clone_testlsgit remote -vtouch clone.txtgit commit -am “add another file”git push
![Page 27: Ruby on Rails 3 Day BC](https://reader033.vdocument.in/reader033/viewer/2022061104/5404497a8d7f72a1768b4697/html5/thumbnails/27.jpg)
Editor
Sublime Text 2 / TextMateRubyMineKomodoEditEclipseVi / Vim / Emacs
![Page 28: Ruby on Rails 3 Day BC](https://reader033.vdocument.in/reader033/viewer/2022061104/5404497a8d7f72a1768b4697/html5/thumbnails/28.jpg)
Sublime Text 2
Command line aliasWin: doskey subl="C:\Program Files\Sublime Text 2\sublime_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
![Page 29: Ruby on Rails 3 Day BC](https://reader033.vdocument.in/reader033/viewer/2022061104/5404497a8d7f72a1768b4697/html5/thumbnails/29.jpg)
BREAK!
10-15 minutes
![Page 30: Ruby on Rails 3 Day BC](https://reader033.vdocument.in/reader033/viewer/2022061104/5404497a8d7f72a1768b4697/html5/thumbnails/30.jpg)
Rails
New Rails AppModify the HomePageScaffoldMVCLayers
![Page 31: Ruby on Rails 3 Day BC](https://reader033.vdocument.in/reader033/viewer/2022061104/5404497a8d7f72a1768b4697/html5/thumbnails/31.jpg)
Create a New App
rails Shows Options
rails new <app_name> --options
![Page 32: Ruby on Rails 3 Day BC](https://reader033.vdocument.in/reader033/viewer/2022061104/5404497a8d7f72a1768b4697/html5/thumbnails/32.jpg)
Create a Class Management App
We want an app to manage Students, Classes, and Teachersrails new class_mngmt
![Page 33: Ruby on Rails 3 Day BC](https://reader033.vdocument.in/reader033/viewer/2022061104/5404497a8d7f72a1768b4697/html5/thumbnails/33.jpg)
The Application Directory
The Root of our App: Rails rootEntire App in one directory!
![Page 34: Ruby on Rails 3 Day BC](https://reader033.vdocument.in/reader033/viewer/2022061104/5404497a8d7f72a1768b4697/html5/thumbnails/34.jpg)
Run the App
cd class_mngmtrails
see rails commandsrails server
![Page 35: Ruby on Rails 3 Day BC](https://reader033.vdocument.in/reader033/viewer/2022061104/5404497a8d7f72a1768b4697/html5/thumbnails/35.jpg)
Save a Baseline with git
git initgit add .git commit -m “add a bare rails app to track changes”
![Page 36: Ruby on Rails 3 Day BC](https://reader033.vdocument.in/reader033/viewer/2022061104/5404497a8d7f72a1768b4697/html5/thumbnails/36.jpg)
Modify the HomePage
public/index.htmlpublic folder contains static content
![Page 37: Ruby on Rails 3 Day BC](https://reader033.vdocument.in/reader033/viewer/2022061104/5404497a8d7f72a1768b4697/html5/thumbnails/37.jpg)
Scaffolding
rails generatesee the generators
rails g scaffold Student full_name age:integer bio:text title
![Page 38: Ruby on Rails 3 Day BC](https://reader033.vdocument.in/reader033/viewer/2022061104/5404497a8d7f72a1768b4697/html5/thumbnails/38.jpg)
MVC
BrowserBrowserRequestRequest
ControllerController
ModelModel
DatabaseDatabase
ViewView
ResponseResponse
![Page 39: Ruby on Rails 3 Day BC](https://reader033.vdocument.in/reader033/viewer/2022061104/5404497a8d7f72a1768b4697/html5/thumbnails/39.jpg)
Shorten Bio Demo
Shorten the bio on the view pageAdd a read more link
![Page 40: Ruby on Rails 3 Day BC](https://reader033.vdocument.in/reader033/viewer/2022061104/5404497a8d7f72a1768b4697/html5/thumbnails/40.jpg)
Helpers
Presentation LogicPresenter PatternRuby Module - Included on all viewsMethod DefinitionsHelp generate html
![Page 41: Ruby on Rails 3 Day BC](https://reader033.vdocument.in/reader033/viewer/2022061104/5404497a8d7f72a1768b4697/html5/thumbnails/41.jpg)
View Exercise
On the main Student pageChange the Listing Students toShow only the Full Name and titleHave the Full Name link to the view pageRemove the view link
![Page 42: Ruby on Rails 3 Day BC](https://reader033.vdocument.in/reader033/viewer/2022061104/5404497a8d7f72a1768b4697/html5/thumbnails/42.jpg)
Lunch!
12pm - 1pm