Upgrade to Pro — share decks privately, control downloads, hide ads and more …

rails group day 7

Avatar for mrkhutter mrkhutter
March 01, 2016
36

rails group day 7

model actions and routing

Avatar for mrkhutter

mrkhutter

March 01, 2016

Transcript

  1. Git Flow • to start: always git pull origin <branch>

    • git checkout -b feature/my_feature_branch • write the code! • commit your code • git add path/to/files • git commit -m “your commit message” • git push • use github.com to make a pull request
  2. MVC

  3. MVC

  4. MVC

  5. MVC

  6. MVC

  7. MVC

  8. Index • Do you want to find a model by

    attribute? • Prevents “full table scan” • To add index • rails g migration AddIndexToTableColumn
  9. Update • updates update_at timestamp • direct update with resave

    • update_attribute(:attribute, value) • update_attributes(attribute1: value, attribute2:value)
  10. Tests • Especially important for teams without QA • Ruby

    is dynamically typed - make sure you get what you are expecting • Provides a developer confidence in their code