-
Notifications
You must be signed in to change notification settings - Fork 7
Agenda for March Workshop [Beginners]
- What is the workshop about.
- What you can expect to get out of this.
- What the agenda is.
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
› Create a new Rails app - rails new tournament-tracker
› Explain MVC
› General talk about Rails (philosophy, why we think its awesome, community)
Food Court.
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
› 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
› 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.
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
› 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
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
› Local ruby community
› Global communities
› MINSWAN
› Participation of women