If you're new to Ruby-on-Rails, keep reading. This three-part article will show you how to do a project setup and proof of concept for a fictional bookstore. In this part, we'll start installing the software. This article is excerpted from chapter one of the book Practical Rails Projects, written by Eldon Alameda (Apress; ISBN: 1590597818).
Ruby on Rails Book Emporium Project (Page 1 of 4 )
Ruby on Rails is highly suited for rapid prototyping; complex functionality can be implemented in hours or even minutes. This will come in handy, because the first thing George, our customer and the owner of Emporium, wants us to do is to implement a proof of concept. He needs to see with his own eyes that Ruby on Rails is not vaporware before he hands us the contract. We are happy to oblige.
In this book, we’ll use a fictional bookstore project to make it easier for you to follow the process of implementing a web application from start to finish. In this chapter, we’ll begin by introducing the Emporium project we will develop in this book. Then we will show you how to install Ruby on Rails and the software needed for implementing the first version of the Emporium application. Next, we’ll provide a brief introduction to the Scrum lightweight project management process, which we use to manage the project team and requirements. Then we’ll show you how to get started with Ruby on Rails by creating the Emporium application. Finally, we’ll implement Emporium’s About page as part of the proof of concept. This is a simple page that shows Emporium’s contact details and will be implemented using code generation, a powerful built-in feature of Ruby on Rails.
Introducing the Emporium Project
We’ll show you how to implement the project exactly as we would do in a real-world project.
One morning our coffee break is interrupted by a furious phone call. On the other end is George, the owner of Emporium, a hip bookstore in downtown Manhattan. George has just received the financial figures for the online sales of his shop, and he is not happy. “We’re losing all our customers to Amazon.” Something must be done.
Emporium’s current online store is functional but rigid and slow, and the customers don’t really like it. Sure, it was fine eight years ago, but now it’s really starting to show its age. “Look at the shop at panic.com,” says George, “you can drag things into the cart there. Why doesn’t that work in my shop?” Sure, George, we got it. George also wants to empower the users more, with syndication of new content (you know, that RSS thingamagick) and forums. He has also heard that tagging is the concept du jour, something a self-respecting online store just can’t live without.
While sitting at the back of his bookstore and spying customers, George has spotted a book called Agile Web Development with Rails being of interest to web hackers. While flipping through the book, he has discovered that Rails is like a breath of fresh air in the world of web applications. Now George wants to know if Rails would be a good fit for his website. “But it must do tagging,” he reminds us, “and don’t forget the drag thing!”
Since George is about the computer-savviest person in the whole store, the system must also be very easy to use even on the administration side. Turns out it also has to integrate with payment gateways, so George is able to bill his customers. And since George is worried about expenses, the system must not cost an arm and a leg (at maximum a leg). “Can you do it? Can Rails do it?” insists George. “Sure,” I reply, just to get back to my coffee mug. But what’s promised is promised, so it’s time to get our hands dirty.
George is not the most organized person in the world, and like most of our customers he has no experience of IT projects. This would normally be a disaster for an IT project, but we have dealt with difficult customers and projects without clear requirements before.
In this book, you will not only learn how to build a working e-commerce site with Ruby on Rails, but we will also teach you techniques and best practices like test-driven development (TDD) that will improve the quality of your application.