Home arrow Ruby-on-Rails arrow Building an Online Book Catalog

Building an Online Book Catalog

Now that we've built an online bookstore application in Ruby-on-Rails, it's time to serve our customers by building a book catalog of the store that they can use for browsing, viewing book details, searching for books, and finding out about new titles at a glance. This article, the first in a three-part series, is excerpted from chapter four of the book Practical Rails Projects, written by Eldon Alameda (Apress; ISBN: 1590597818).

Author Info:
By: Apress Publishing
Rating: 5 stars5 stars5 stars5 stars5 stars / 1
May 17, 2010
  1. · Building an Online Book Catalog
  2. · Implementing the Book Catalog Interface
  3. · Implementing the Browse Books User Story
  4. · Running the Integration Test

print this article

Building an Online Book Catalog
(Page 1 of 4 )

In this chapter, we’ll work through setting up the basic functionality of a book catalog from the customer’s perspective. We’ll build the chapter around four user stories where Jill, George’s book-hogging customer, plays the starring role.

For the Emporium book catalog, we will create a simple catalog page for the books, along with pages that display details for individual titles. The interface also will need a way to search for books by their titles and descriptions. We will use Ferret, a full-text search engine written in Ruby, to supply this functionality. Additionally, we will create a latest books page and RSS feed, so that Jill can follow what’s new at Emporium.

Getting the Book Catalog Requirements

If there’s one person keeping Emporium going, that’s Jill. Jill lives just a couple of blocks away from the store. When she rushes through the door with her plasma-TV-sized goggles, George knows that the day is saved.

However, Jill’s health is not as it used to be. Her visits have gotten fewer and fewer lately. She would love to support George and buy a lot of new books, but it’s just too much effort for her to come over daily. Jill is a smart lady, though, and she’s found out that this new thing called the Internet can work as an intermediary between her and her beloved book supply.

To make Jill a happy online customer, George comes up with four user stories for this sprint:

  1. Browse books: Jill needs a way to browse the books in the shop. We will keep the list really simple at this point, just letting her shuffle through the supply and find out about new titles. 
  2. View book details: After browsing through titles in the first story or getting a list of matching titles in the second one, Jill needs a way to get specific information about a particular title. As a former librarian, she is obsessed about knowing even the most mundane details of every book she is thinking about buying. 
  3. Search books: Sometimes Jill finds out about an interesting topic and wants to know more about the subject. She needs to be able to write a few keywords and get a list of all the titles that match her search. 
  4. Get latest books: As a book addict, Jill needs a way to keep current about all new books. She would like to find out about new titles with a single look on the Emporium site. What would make her really happy, however, would be an RSS feed that she could follow on her shiny white iBook without even visiting the website. That would leave her more time for her real pleasure, perusing her precious tomes.

We will tackle these user stories in this chapter, one by one, using the already familiar TDD method.

blog comments powered by Disqus

- Ruby-on-Rails Faces Second Security Flaw in ...
- Ruby 2.0 Prepped for February 2013 Release
- Why LinkedIn Switched from Ruby on Rails
- Adding Style with Action Pack
- Handling HTML in Templates with Action Pack
- Filters, Controllers and Helpers in Action P...
- Action Pack and Controller Filters
- Action Pack Categories and Events
- Logging Out, Events and Templates with Actio...
- Action Pack Sessions and Architecture
- More on Action Pack Partial Templates
- Action Pack Partial Templates
- Displaying Error Messages with the Action Pa...
- Action Pack Request Parameters
- Creating an Action Pack Registration Form

Watch our Tech Videos 
Dev Articles Forums 
 RSS  Articles
 RSS  Forums
 RSS  All Feeds
Write For Us 
Weekly Newsletter
Developer Updates  
Free Website Content 
Contact Us 
Site Map 
Privacy Policy 

Developer Shed Affiliates


© 2003-2019 by Developer Shed. All rights reserved. DS Cluster - Follow our Sitemap
Popular Web Development Topics
All Web Development Tutorials