Skip to content

Agenda for March Workshop [Beginners]

Marco Bon edited this page Mar 21, 2015 · 9 revisions

Program for Workshop: Aug-2

Introduction - 15 mins - 11:00 - 11:15

  • What is the workshop about.
  • What you can expect to get out of this.
  • What the agenda is.

Intro to Ruby (1 hour)

Ruby basics - 20 mins - 11:15 - 11:35

› ruby hello-world-program.rb
› Arrays › Hash › Iterators - touch of blocks

Ruby OOP - 20 mins - 11:35 - 11:55

› Class and method
› Ruby Object model

Ruby gems - 15 mins - 11:55 - 12:10

› Intro to the gem ecosystem
› Ruby standard library
› ruby-toolbox.com

Intro to Rails 20 mins - 12:10 - 12:30

› Create a new Rails app - rails new tournament-tracker

› Explain MVC

› General talk about Rails (philosophy, why we think its awesome, community)

Lunch n Networking (12:30 - 1:15)

Food Court.

Scaffolding - 15 mins (1:15 - 1:35)

Sample app: App to record and maintain Cricket Tournament results.

resource: team with typical properties:
name, governing_body, test_status

The scaffold resource: Team

rails g scaffold team name:string governing_body:string test_status:boolean

rake db:create

rake db:migrate

» [Browse] localhost:3000/teams

› Walkthrough files created

Tournaments 20 mins (1:15 - 1:45)

rails g model tournament name:string country:string start_date:date end_date:date

rake db:migrate

rails console - create tournament in console and basic querying

› Scaffold Controllers & Views - rails g scaffold tournament name:string country:string start_date:date end_date:date (use override all option)

› [Browse] localhost:3000/tournaments

› explain REST & Routing

Matches 1 hour (1:45 - 2:45)

› A note on foreign keys.

› Create Match model - rails g model match match_date:date tournament_id:integer team_1:integer team_2:integer team_1_runs:integer team_2_runs:integer

› Views for match - rails g controller matches new create show edit update

› nest matches route in tournaments

› Setup associations

 Tournament
   has_many :matches

 Match
   belongs_to :tournament
   belongs_to :team_1, class: Team, foreign_key: :team_1_id
   belongs_to :team_2, class: Team, foreign_key: :team_2_id

 Team
   has_many :matches_as_team_1, class: Match, foreign_key: :team_1_id
   has_many :matches_as_team_2, class: Match, foreign_key: :team_2_id

   def matches
     matches_as_team_1.merge matches_as_team_2
   end

› List matches in tournaments#show

› Manually implement views and actions for MatchesController

› Create index page with links to /tournaments and /teams and set root route to it.

Deploy to Heroku 45 mins - 2:45 - 3:30

Here we try to get app deployed to heroku

Heroku account setup

› create heroku account

› install heroku toolbelt

heroku create tournament-tracker-<your_name>

git remote add heroku [email protected]:tournament-tracker-<your_name>.git

Heroku Deploy

› Edit Gemfile: replace 'sqlite3' with 'pg'

git init .

git add .

git commit -m 'first commit'

git push heroku master

heroku run rake db:migrate

› [Lecture][short] What happened in the deployment

ActiveRecord Querying - 30 mins - 3:30 - 4:00

› AR vs Raw SQL - SQL generation & Data to Model mapping.

› Finders & Creators

› Pluck

› Where, Group, Order, Having, Limit

› Joins

› Chaining & Lazy loading

› AR Relation & its methods

Terms: walkthrough 30 mins - 4:00 - 4:30

Very small details about some commonly heard terms.
To just get people started

› Version managers: rvm, rbenv
› Internationalization
› Front-end: Jquery, Ember
› Design: Bootstrap
› Testing: TDD
› Sys-admin: Nginx, Apache, Ubuntu, Capistrano, unicorn
› Cloud: Heroku, AWS, Digital Ocean
› Server automation: Chef, Puppet, Ansible, Docker

About the Ruby Community 15 mins - 4:30 - 4:45

› Local ruby community
› Global communities
› MINSWAN
› Participation of women