Ruby on Rails  3-Day BootCamp                   1
IntroductionsNameCoding ExperienceWhat would you like to learn?                                2
CurriculumRoR ToolsetRails Walk-ThroughGems and DeploymentFull Apps and Ruby inside Rails                                  3
Schedule   Times         Day 1           Day 2           Day39am - 10:30      Tools        RubyToolBox     BootStrap   Bre...
Learning GoalsBasic RailsCommon Patterns and PracticesWhere to go for help                                5
Learning PathExperimentationTest First TeachingAsk QuestionsResources for finding answers                                6
StructureExplanation (me talking)Demonstration (me typing)Experimentation (in-class coding)Questions                      ...
RoR ToolsRVM / Pik / Jewelry Box / Rb.EnvGit / Github / HerokuSublime / Vi / RubyMineRubyGems / RubyToolboxTesting / RSpec...
RoR Resources      RailsGuides - guides.rubyonrails.org      Rails API - api.rubyonrails.org      RubyDoc - ruby-doc.org  ...
Ruby vs. RailsRuby is the Language -  developed 1993  Yukihiro Matsumoto “Matz”Rails is the Framework -  developed 2004  D...
The Ruby WayWritten in CInfluenced by SmallTalk & PearlRuby is for PeopleMINSWANOSS (Open Source Software)RubyGems        ...
The Rails WayOpinionated SoftwareConvention over ConfigurationDRY (Don’t Repeat Yourself)TDD (Test Driven Development)Less...
ToolsCommand LineRuby / RubyGemsRailsSource Control - GitIDEDeployment - Heroku                       13
Command LineCommand Prompt (CLI)Mac: Terminal, iTerm, etc...Unix: bash, zsh, csh, etc....Windows: Command Prompt w/ Ruby o...
RubyRuby -v  1.9.2, 1.9.3, 2.0.0 (1.8.7)gem list  Bundler, Rake, rubygems, etc...                                    15
RVMRuby Version Manager rvm list rvm use rvm gemset list             rvm.io                       16
Ruby VersionsMRI, YARV, Standard Library, C-RubyJRuby - JavaRubinius - Pure RubyMagLev - SmallTalkMacRuby - Objective-CIro...
RailsRails -v  2.0-3, 3.0-2, 4.0                      18
RVM DemoGemset for Rails 4  rvm use --create 2.0.0@rails4  gem install rails   --version 4.0.0.beta1  mkdir rvm_test  cd r...
Gitwhich gitgit --version                      20
GitSource Control SystemTimeline, Track ChangesBranching and MergingCode Safety                          21
Git Commandsgit clone / initgit statusgit add / rmgit commitgit pushgit log                    22
Git RemotesGitHub - www.github.comHeroku - www.heroku.com                          23
Git HelpGit Site - git-scm.comGit Immersion - gitimmersion.comGitHub Help - help.github.com                               ...
Git Demomkdir git_testcd git_testgit inittouch test_file.txtgit statusgit add .git commit -m “add a file”git status       ...
Git Democd ..git clone git_test/.git clone_testcd clone_testlsgit remote -vtouch clone.txtgit commit -am “add another file...
EditorSublime Text 2 / TextMateRubyMineKomodoEditEclipseVi / Vim / Emacs                            27
Sublime Text 2              Command line alias                   Win: doskey subl="C:Program FilesSublime Text 2sublime_te...
BREAK!10-15 minutes                    29
RailsNew Rails AppModify the HomePageScaffoldMVCLayers                      30
Create a New Apprails  Shows Optionsrails new <app_name> --options                                 31
Create a        Class Management App              We want an app to manage Students,              Classes, and Teachers   ...
The Application     DirectoryThe Root of our App: Rails rootEntire App in one directory!                                  33
Run the App               cd class_mngmt               rails                 see rails commands               rails server...
Save a Baseline                         with git               git init               git add .               git commit -...
Modify the HomePagepublic/index.htmlpublic folder contains static content                                        36
Scaffolding                rails generate                     see the generators                rails g scaffold Student f...
MVC          Response                         Controller          RequestBrowser           View                           ...
Shorten Bio DemoShorten the bio on the view pageAdd a read more link                                   39
HelpersPresentation LogicPresenter PatternRuby Module - Included on all viewsMethod DefinitionsHelp generate html         ...
View ExerciseOn the main Student page  Change the Listing Students to My  Students or All Students  Show only the Full Nam...
Lunch!12pm - 1pm                      42
Routingrake routespublic folder                    43
hello.htmlcreate a hello filefind it in the browser                         44
RESTful RoutesRepresentational State Transfer(REST)guides.rubyonrails.org/routing.html                                    ...
Controller Actionsindex, show, new, edit, create,update, destroy                                  46
New Controllerrails g controller Welcome                             47
Welcomeput hello.html in the welcome folderapp/views/welcome/hello.html                                       48
Find it!http://localhost:3000/welcome/hello                                      49
Break!10-15 minutes                    50
Active RecordRuby Driven SchemaWhere are the methods?                         51
Students Manage   Their CoursesAs a student we want to add ourcourses.                                  52
Add Coursesrails g Course title description:textstudent_id:integer                                        53
RelationshipsStudent has many coursesA Course belongs_to a Student                                54
3 Kinds of    Relationshipsone-to-oneone-to-manymany-to-many                    55
Rails DB / Consolerails db  login with the db credentialsrails console  irb with your app loaded                          ...
Add email to Student rails g migration AddEmailToStudents email                                        57
Test Driven Railsadd rspectest drive our business rules                                58
Validations &      callbacksguides.rubyonrails.org/active_record_validations_callbacks.htmlValidate a Student has a name  ...
Validate the student       email presence and format                       60
Scopes and QIsaved sql querieshttp://guides.rubyonrails.org/active_record_querying.html                                 61
Environmentsdevelopmenttestproduction                      62
Rails App Walk      ThroughWhat is all this stuff?!                           63
Questions???                  64
Upcoming SlideShare
Loading in …5
×

PDF Ruby on Rails 3 Day BC

800 views
612 views

Published on

PDF version of the boot camp slides

Published in: Education
0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total views
800
On SlideShare
0
From Embeds
0
Number of Embeds
5
Actions
Shares
0
Downloads
21
Comments
0
Likes
0
Embeds 0
No embeds

No notes for slide
  • • RailsGuides - guides.rubyonrails.org • Rails API - api.rubyonrails.org • RubyDoc - ruby-doc.org • RailsCasts - railscasts.com • Github ReadMe • Ruby ToolBox - www.ruby-toolbox.com
  • Command line aliasWin: doskey subl=&quot;C:\\Program Files\\Sublime Text 2\\sublime_text.exe&quot; $*Mac: ln -s &quot;/Applications/Sublime Text 2.app/Contents/SharedSupport/bin/subl&quot; ~/bin/sublLinux: sudo ln -s /opt/SublimeText2/sublime_text /usr/bin/sublHow to Open a folder
  • rails new class_mngmt
  • rails server
  • git init git add . git commit -m “add bare rails app to track”
  • rails g scaffold Student full_name age:integer bio:text title
  • PDF Ruby on Rails 3 Day BC

    1. 1. Ruby on Rails 3-Day BootCamp 1
    2. 2. IntroductionsNameCoding ExperienceWhat would you like to learn? 2
    3. 3. CurriculumRoR ToolsetRails Walk-ThroughGems and DeploymentFull Apps and Ruby inside Rails 3
    4. 4. Schedule Times Day 1 Day 2 Day39am - 10:30 Tools RubyToolBox BootStrap Break Scaffold and RailsApps and10:45 - 12 Cucumber Views Hobo / Spree Lunch Routes and1pm - 2:30 Devise Calculator Controllers Break Models and2:45 - 4:30 I18N and Haml Translator Testing 4
    5. 5. Learning GoalsBasic RailsCommon Patterns and PracticesWhere to go for help 5
    6. 6. Learning PathExperimentationTest First TeachingAsk QuestionsResources for finding answers 6
    7. 7. StructureExplanation (me talking)Demonstration (me typing)Experimentation (in-class coding)Questions 7
    8. 8. RoR ToolsRVM / Pik / Jewelry Box / Rb.EnvGit / Github / HerokuSublime / Vi / RubyMineRubyGems / RubyToolboxTesting / RSpec / CucumberTerminal / irb / Rails Console 8
    9. 9. 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 9 • RailsGuides - guides.rubyonrails.org • Rails API - api.rubyonrails.org • RubyDoc - ruby-doc.org • RailsCasts - railscasts.com • Github ReadMe • Ruby ToolBox - www.ruby-toolbox.com
    10. 10. Ruby vs. RailsRuby is the Language - developed 1993 Yukihiro Matsumoto “Matz”Rails is the Framework - developed 2004 David Heinemeier Hansson “DHH” 10
    11. 11. The Ruby WayWritten in CInfluenced by SmallTalk & PearlRuby is for PeopleMINSWANOSS (Open Source Software)RubyGems 11
    12. 12. The Rails WayOpinionated SoftwareConvention over ConfigurationDRY (Don’t Repeat Yourself)TDD (Test Driven Development)Less Code, More Productivity 12
    13. 13. ToolsCommand LineRuby / RubyGemsRailsSource Control - GitIDEDeployment - Heroku 13
    14. 14. Command LineCommand Prompt (CLI)Mac: Terminal, iTerm, etc...Unix: bash, zsh, csh, etc....Windows: Command Prompt w/ Ruby onRails 14
    15. 15. RubyRuby -v 1.9.2, 1.9.3, 2.0.0 (1.8.7)gem list Bundler, Rake, rubygems, etc... 15
    16. 16. RVMRuby Version Manager rvm list rvm use rvm gemset list rvm.io 16
    17. 17. Ruby VersionsMRI, YARV, Standard Library, C-RubyJRuby - JavaRubinius - Pure RubyMagLev - SmallTalkMacRuby - Objective-CIronRuby - C# (for .Net) 17
    18. 18. RailsRails -v 2.0-3, 3.0-2, 4.0 18
    19. 19. RVM DemoGemset 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 19
    20. 20. Gitwhich gitgit --version 20
    21. 21. GitSource Control SystemTimeline, Track ChangesBranching and MergingCode Safety 21
    22. 22. Git Commandsgit clone / initgit statusgit add / rmgit commitgit pushgit log 22
    23. 23. Git RemotesGitHub - www.github.comHeroku - www.heroku.com 23
    24. 24. Git HelpGit Site - git-scm.comGit Immersion - gitimmersion.comGitHub Help - help.github.com 24
    25. 25. Git Demomkdir git_testcd git_testgit inittouch test_file.txtgit statusgit add .git commit -m “add a file”git status 25
    26. 26. Git Democd ..git clone git_test/.git clone_testcd clone_testlsgit remote -vtouch clone.txtgit commit -am “add another file”git push 26
    27. 27. EditorSublime Text 2 / TextMateRubyMineKomodoEditEclipseVi / Vim / Emacs 27
    28. 28. 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 28Command line aliasWin: doskey subl="C:Program FilesSublime Text 2sublime_text.exe" $*Mac: ln -s "/Applications/Sublime Text 2.app/Contents/SharedSupport/bin/subl" ~/bin/sublLinux: sudo ln -s /opt/SublimeText2/sublime_text /usr/bin/sublHow to Open a folder
    29. 29. BREAK!10-15 minutes 29
    30. 30. RailsNew Rails AppModify the HomePageScaffoldMVCLayers 30
    31. 31. Create a New Apprails Shows Optionsrails new <app_name> --options 31
    32. 32. Create a Class Management App We want an app to manage Students, Classes, and Teachers rails new class_mngmt 32rails new class_mngmt
    33. 33. The Application DirectoryThe Root of our App: Rails rootEntire App in one directory! 33
    34. 34. Run the App cd class_mngmt rails see rails commands rails server 34rails server
    35. 35. Save a Baseline with git git init git add . git commit -m “add a bare rails app to track changes” 35git initgit add .git commit -m “add bare rails app to track”
    36. 36. Modify the HomePagepublic/index.htmlpublic folder contains static content 36
    37. 37. Scaffolding rails generate see the generators rails g scaffold Student full_name age:integer bio:text title 37rails g scaffold Student full_name age:integer bio:text title
    38. 38. MVC Response Controller RequestBrowser View Model Database 38
    39. 39. Shorten Bio DemoShorten the bio on the view pageAdd a read more link 39
    40. 40. HelpersPresentation LogicPresenter PatternRuby Module - Included on all viewsMethod DefinitionsHelp generate html 40
    41. 41. View ExerciseOn the main Student page Change the Listing Students to My Students or All Students Show only the Full Name and title Have the Full Name link to the view page 41
    42. 42. Lunch!12pm - 1pm 42
    43. 43. Routingrake routespublic folder 43
    44. 44. hello.htmlcreate a hello filefind it in the browser 44
    45. 45. RESTful RoutesRepresentational State Transfer(REST)guides.rubyonrails.org/routing.html 45
    46. 46. Controller Actionsindex, show, new, edit, create,update, destroy 46
    47. 47. New Controllerrails g controller Welcome 47
    48. 48. Welcomeput hello.html in the welcome folderapp/views/welcome/hello.html 48
    49. 49. Find it!http://localhost:3000/welcome/hello 49
    50. 50. Break!10-15 minutes 50
    51. 51. Active RecordRuby Driven SchemaWhere are the methods? 51
    52. 52. Students Manage Their CoursesAs a student we want to add ourcourses. 52
    53. 53. Add Coursesrails g Course title description:textstudent_id:integer 53
    54. 54. RelationshipsStudent has many coursesA Course belongs_to a Student 54
    55. 55. 3 Kinds of Relationshipsone-to-oneone-to-manymany-to-many 55
    56. 56. Rails DB / Consolerails db login with the db credentialsrails console irb with your app loaded 56
    57. 57. Add email to Student rails g migration AddEmailToStudents email 57
    58. 58. Test Driven Railsadd rspectest drive our business rules 58
    59. 59. Validations & callbacksguides.rubyonrails.org/active_record_validations_callbacks.htmlValidate a Student has a name 59
    60. 60. Validate the student email presence and format 60
    61. 61. Scopes and QIsaved sql querieshttp://guides.rubyonrails.org/active_record_querying.html 61
    62. 62. Environmentsdevelopmenttestproduction 62
    63. 63. Rails App Walk ThroughWhat is all this stuff?! 63
    64. 64. Questions??? 64

    ×