Skip to Content
Rails: Up and Running, 2nd Edition
book

Rails: Up and Running, 2nd Edition

by Bruce Tate, Lance Carlson, Curt Hibbs
October 2008
Beginner to intermediate
224 pages
5h 34m
English
O'Reilly Media, Inc.
Content preview from Rails: Up and Running, 2nd Edition

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

More than 5,000 organizations count on O’Reilly

AirBnbBlueOriginElectronic ArtsHomeDepotNasdaqRakutenTata Consultancy Services

QuotationMarkO’Reilly covers everything we've got, with content to help us build a world-class technology community, upgrade the capabilities and competencies of our teams, and improve overall team performance as well as their engagement.
Julian F.
Head of Cybersecurity
QuotationMarkI wanted to learn C and C++, but it didn't click for me until I picked up an O'Reilly book. When I went on the O’Reilly platform, I was astonished to find all the books there, plus live events and sandboxes so you could play around with the technology.
Addison B.
Field Engineer
QuotationMarkI’ve been on the O’Reilly platform for more than eight years. I use a couple of learning platforms, but I'm on O'Reilly more than anybody else. When you're there, you start learning. I'm never disappointed.
Amir M.
Data Platform Tech Lead
QuotationMarkI'm always learning. So when I got on to O'Reilly, I was like a kid in a candy store. There are playlists. There are answers. There's on-demand training. It's worth its weight in gold, in terms of what it allows me to do.
Mark W.
Embedded Software Engineer

You might also like

Ruby on Rails: Up and Running

Ruby on Rails: Up and Running

Bruce Tate, Curt Hibbs
Rails 3 in Action

Rails 3 in Action

Yehuda Katz, Ryan Bigg

Publisher Resources

ISBN: 9780596522001Errata Page