Week 5 - Working with data in Rails

Solar System seeds.rb

My Version of the Poetry Assignment

My Version of the Solar System Assignment


Week 5 Assignment #1

This one is easy. You just have to email me about how things are going for you in the class. Questions to answer:

  • How is the class for you?
  • What are the most useful parts - take home assignments, code walkthroughs?
  • Is there anything you'd like to have more of, or less of, or none-at-all of?

Week 5 Assignment #2

Click through for all the details.



Resources

IMG 240: Git basics

IMG 240: Creating a Rails application

Ruby Enumerable (these are methods used by Array and Hash – here’s a pretty good collections tutorial that might be useful)



ActiveRecord Resources

ActiveRecord Basics (different methods for adding/updating/deleting records, especially part 5)

ActiveRecord Querying (different methods for querying your model, include part 14)

ActiveRecord Associations (part 2.7 is important, focus on belongs_to, has_one, has_many for now)

ActiveRecord Collection Methods (an explanation of the methods you get after creating an association – not the easiest to read, but worth understanding)



General Rails Resources

Rails Command Line Reference (generator commands)

Rails Routing Reference (how to setup your routes file)

Rails ActionView Helpers (explore UrlHelper, TextHelper, NumberHelper and anything else that catches your eye - you can use any of these functions in your HTML template files)



An interesting article about learning to code

Why Learning to Code is So Damn Hard

Want more to learn?

This video by Sandi Metz is fantastic for learning about organizing code.

Seven ways to decompose fat ActiveRecord models is an interesting look at what happens when models get large (lots of methods) in Rails, and what can be done about it.