Homework for 6B

Review

Topics Covered: Rails scaffolding; building Twitter


Exercises

You'll notice that as we get further into the lectures and learn more about Rails, the exercises become less guided. Instead of "write a function that does x, y, and z" with sample code, test cases, and solutions, it'll be more like "Build an app that does X!". It'll be up to you to apply all the principles of planning, stress testing and actually coding that we've learned so far.

E1: The Purrfect Social Network

Part of iExperience's mission statement is to use technology to solve real world problems. While sitting around chatting about the future of innovative technology, the TAs realized that there isn't a single social network for cats. Not even one. Unfortunately, we also acknowledged that with all the important TA stuff that we do, we won't have time to create MeowBook. This important quest falls to you, and cats all over the world are counting on your abilities to:

  1. Create a new app in your d6 folder called 'meowbook'
  2. Generate the scaffolding for the 'User' resource which stores the user's name
  3. Generate the scaffolding for the 'Post' resource which stores the post's username and body.
  4. Add a link on the users page that links to the posts page and a link on the posts page that links to the users page. Use the rails helper method for this!
  5. Add a picture of a cute cat on one of your pages. Use the rails helper method for this as well!

The exact syntax for the first three commands is very important. This even includes whether or not certain words are capitalized or pluralized, so make sure that you follow the conventions for this, and if you're ever unsure, you can refer back to this morning's slides for reference.

E2: Follow up

Make sure you've finished the previous days' exercises, including Shopping Cart, TicTacToe (including some AI if you're interested) and Ruby Koans. Where answers have been released, compare and make sure your code works. Please take the time to do this. Putting in a little bit of time to feel confident about the concepts now will make learning Rails so much faster. Yay speed.


Projects

And so it begins

You've spent the past few days training hard to sharpen your skills in Ruby. With the aid of the weaponsmiths of Treehouse, your arsenal now includes HTML, CSS, and JavaScript. You've sweated under the guidance of the Master and have become well versed in the mystic lore of the Koans. The time has now come to finally put these skills to good use. It's time to build a Rails app! (Insert Black Gate backdrop here.)

But before you dive right in, you first need to spend some time thinking about exactly what it is you want to build. This step is extremely important. You're going to be spending the next two or so weeks (possibly longer) working on this project. You want to be sure it's something you are passionate about, otherwise all that work will seem laborious rather than exciting.

We want you to think about the problems in your life, or about the problems in the lives of those you care about. There are so many ways (like with SOLAR FREAKIN' ROADWAYS) in which we can make the lives of ten, a thousand, or a million people's lives better, easier, less painful, healthier, and on and on. But before we get to that scale, we first need to start by thinking about two things:

Keep those questions in the back of your mind over the course of this week. Spend today taking a first crack at writing your final project proposal. It is not by any means the final idea—your idea will grow and evolve as you learn more and see more of the world. By Friday, you should have a brief description (200-300 words) and a list of features (10-20) for the first version of your application. You will be presenting your idea to the class on Friday afternoon. After the presentations, you will have the option to either stick with your original idea or join another group.

A project proposal for Meowbook might look something like this:

# Meowbook app
#### By Ruby (the Cat), June 25, 2014

## Description

I want to build an application to make it easier for cats to update friends,
family, and other acquaintances on the fleeting thoughts I have about the world.
I want to be able to quickly and easily share what I'm eating, where I'm sleeping
in the morning, licking regimes I'm experimenting with, or whatever else, with 
anyone who's interested. I want to be able to "follow" cats I think are cool or 
are sharing cool things to get real-time updates on their thoughts, and like or 
reshare stuff to the cats following me.

## Features

1. Create an account
  - The account should be secure: it should have a pawsword
2. Add my purrrsonal info
3. Share something (I'll call this a Meow)
  - Add images, videos and lynx into my Meows
4. See what other cats have shared
5. Follow the cats I think are cool (my furriends)
6. See all the content from all the cats I think are cool
  - Be able to reshare what they shared
  - Be able to like what they shared

That's already about 10 features, and you can easily think of more.

Remember to be creative and look for real problems to solve. If you need some inspiration, or want to tackle a local problem, try chatting to some of the locals. Ask them about problems they experience in their daily lives around the city. The more interesting and topical your problem, the more awesome your app. Happy final projects and may the odds be ever in your favor! (Insert Mockingjay call here.)