Skip to Content
Ruby on Rails For Dummies®
book

Ruby on Rails For Dummies®

by Barry Burd
January 2007
Beginner
330 pages
6h 52m
English
Wiley
Content preview from Ruby on Rails For Dummies®

Chapter 11. Image Is Everything

In This Chapter

  • Storing photos (and other binary data) in a database

  • Uploading images (and other data) to a Web site

  • Working with a request and its response

Everyone has phobias. My uncle is afraid of heights. My best friend from high school is afraid of aging. (Too bad! Heights are easier to avoid than aging.) A student of mine is afraid of fish. A colleague in my department is afraid of mirrors (as well he should be). My cat is afraid of wolves. And me? I'm afraid of things that loosely dangle, such as hanging threads, orphan sentences, and other such things.

There must be a name for this kind of phobia. Maybe it's loosia‐danglo‐phobia. (Don't confuse this ailment with Lucy‐phobia, which pertains only to old television sitcoms.) I don't know what bothers me about loosely dangling things. You can't account for taste or for phobias. Maybe I was frightened by a loosely dangling thing when I was a young child. (Or maybe I'm just crazy!)

Anyway, this book has a stunning example of a loosely dangling thing. It's a file stored in a Rails project's public\images directory.

The skeptics among you might ask “What's dangling about the public\images directory?” The answer is in Chapter 10. In that chapter, you create a database that supposedly stores all information about photos. But this big, hulking database doesn't store images. Instead, the database stores filenames. These filenames are frail tentacles that extend outside the database and into the rest of the ...

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
Ruby on Rails® Bible

Ruby on Rails® Bible

Timothy Fisher
Learning Rails 5

Learning Rails 5

J. Mark Locklear, Eric J Gruber, Barnabas Bulpett

Publisher Resources

ISBN: 9780470081204Purchase book