Midterm and homework for rails