Seeing Real Photos
This chapter is highly dependent on previous chapters, so if you are implementing this Photo Share application as you read, make sure that you are starting this chapter with the same source code that we have. For example, in the previous chapter, when you generated the scaffolding for each of the database tables, you could easily have let the scaffold generator overwrite the model classes in which we had specified the relationships between the tables.
The easiest way to make sure you are starting with the right code is to download our ZIP file that contains everything we have done up to this point. You can find this file on the book’s website: http://www.oreilly.com/catalog/9780596522001. You will want to copy over the config/database.yml.example file to config/database.yml and then update the configuration specifically for your local database.
You also need some real photos to display. That same ZIP file contains sample photos in the public/images/photos directory. Of course, you'd normally want the user to upload their own photos, but we'll skip that problem for now so we can focus on building views.
And, finally, make sure that your database contains the same data as
ours. Use rake photos:reset to
recreate the tables and data in your Photo Share database.
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access