/ruby_april_2018

Ruby Class Repo

Primary LanguageRuby

Coding Dojo - Ruby on Rails April 2018

Welcome Rubyists

“Often people, especially computer engineers, focus on the machines. They think, "By doing this, the machine will run faster. By doing this, the machine will run more effectively. By doing this, the machine will something something something." They are focusing on machines. But in fact we need to focus on humans, on how humans care about doing programming or operating the application of the machines. We are the masters. They are the slaves.”

  • Yukihiro Matsumoto

Setup

  1. Fork this repo to your github account.
  2. Clone it locally onto your laptop.
  3. Create a folder with your name, ex: cody_williams
  4. Add this (https://github.com/CodingDojoDallas/ruby_april_2018/) repo as a REMOTE to your locally cloned copy.
git remote add upstream https://github.com/codingdojodallas/ruby_april_2018
  1. Profit!

Daily Commits

Please commit daily. That way we can provide you with feedback :) or just a thumbs up if everything looks good. Here is a good resource that describes how daily commit process should go.

https://www.dropbox.com/s/h3texmoqm801j8w/github_workflow_v4.pdf?dl=0

NOTE: If you don't get in at least one pull request daily, then ya ain't serious.

Videos

Intro - https://youtu.be/XfbT0kzTHTk
OOP Visibility - https://youtu.be/K6kvQKuu384
Model I - https://youtu.be/sYGLc39Rwwk
Routes/Whitelisting - https://youtu.be/ySsDwaXGExE
Models Review - https://youtu.be/m0QmSo2IGAc

Demos

Virtual Machine - https://youtu.be/XfbT0kzTHTk
Self-Join - https://youtu.be/FOCP29sCh8g
Ninja Gold - https://youtu.be/2p1978Wd-2Q
Login - https://youtu.be/zIxl4Q0TjEg
Belt Review - https://youtu.be/1nH0FiAJWt4
Deployment - https://youtu.be/mfeBnAG2rbA

Resources

Ruby v2.3.1 Documentation

Rails v4.2.7 Documentation

Ruby Style Guide

Active Record Validations

http://www.rubyinside.com/

https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers

http://api.rubyonrails.org/classes/ActiveRecord/QueryMethods.html

http://api.rubyonrails.org/classes/ActiveModel/Validations/HelperMethods.html

Articles

Puts vs. Print vs. P

Understanding Ruby Blocks

Creating Multiple Associations with the Same Table

Understanding Polymorphic Associations

What's the Deal With Polymorphic Associations?

Creating Polymorphic Associations in Rails

Active Record Callbacks

An important note: before_save is called every time an object is saved. So for new and existing objects. (create and update action) before_create only before creation. So only for new objects (create action, but not update)