Topics Covered: Controllers and routes.
We've learned a lot today, so let's take some to time review. Routes (found in routes.rb
) are mapped to actions in controllers. Said another way, the paths defined in routes.rb
show Rails which actions in your controller to use for each paritcular URL pattern. Take a look at the following four actions and suggest which routes each of them correspond to. (Use the tweet resource in today's lecture for reference data.)
@
in front of some of them?/users
? Draw a relationship diagram showing the MVC structure and how it interacts to render the /users
URL in a browser. Number the steps.On to the goal of creating a desperately-needed social platform for the feline community! Return to your Meowbook project folder. For each of the following components, create a comment at the top of the file that outlines the function of the file in question. What does it do? Which files rely on it?
UsersController
user.rb
modelindex.html.erb
viewroutes.rb
Hopefully you've settled on an idea or two for your final project by this point. If you're still struggling to think of something, make sure you make this a priority for the rest of the day. Remember that you'll be presenting to the group tomorrow!
The presentations will be short, 3-4 minutes, so make sure your pitch only includes the important points of your idea. You can use multimedia if you want, but this shouldn't be more than a handful of slides. If you haven't yet met with a TA to discuss your idea, make sure you do so before the end of the day.
N.B. Watch the new Hunger Games trailer if you haven't yet.
P.S. It's awesome.