Home arrow Ruby-on-Rails arrow Building a Basic Ruby-on-Rails Application

Building a Basic Ruby-on-Rails Application

If you have a basic grounding in the Ruby-on-Rails framework and are ready to dig in and build your first application, keep reading. This four-part article series will walk you through it. This article is excerpted from chapter three of the book Beginning Rails: From Novice to Professional, written by Jeffery Allan Hardy, Cloves Carneiro Jr. and Hampton Catlin (Apress; ISBN: 1590596862).

Author Info:
By: Apress Publishing
Rating: 5 stars5 stars5 stars5 stars5 stars / 3
February 07, 2011
  1. · Building a Basic Ruby-on-Rails Application
  2. · Creating the Events Application

print this article

Building a Basic Ruby-on-Rails Application
(Page 1 of 2 )

The best way to learn a programming language or a web framework is to dig in and write some code. After reading the first two chapters, you should have a good understanding of the Rails landscape. This chapter builds on that foundation by walking you through the construction of a basic application. Youíll learn how to create a database and how to connect it to Rails, as well as how to use a web interface to get data in and out of the application.

Youíll receive a lot of information in this chapter, though not more than you can absorb, we hope. Our goal here is demonstrate, not to overwhelm. As youíll see, Rails makes it incredibly easy to get started, and thatís a feature we want to highlight. There are a few places where Rails really shines, and getting something running is one of them. By the end of this chapter, youíll have a working web application to play with, explore, and learn from. Weíll build on this application throughout the rest of the book, adding features and refining functionality.

An Overview of the Project

Weíre going to build a simple event-management system that will let us create and manage upcoming events, not unlike Upcoming.org or Evite. Our first iteration will focus on the basics: creating and editing events.

Before we start coding though, letís sketch out a brief summary of the goals and flow of the application. Weíre going to stay at a very high level. The idea is not to focus on the nitty-gritty, but instead to concentrate on the general case.

Our application will have two kinds of users: those who create events and those who wish to attend events. In some cases, people will play both roles. All users will need to create an account by registering on the site. It would also be nice if people could notify their friends of interesting events with a ďsend to friendĒ feature that sends out a friendly email notification to interested parties.

These are some of the features we will add in later chapters. Other application requirements will likely come up as we continue, but these will be enough to get started. In the real world, specifications are seldom correct the first time around, so itís best not to dwell on them. Youíll see right away that Rails doesnít penalize you for making changes to an application thatís already under construction, so we can engage in an iterative style of development, adding and incrementing functionality as we go.

Weíll start with what matters most: events. You might be wondering why we donít start with users. After all, without users, who will create the events? We could begin with users, but if you think about it, without events, what could users do? Events are clearly the epicenter of the application, so it makes the most sense to start there and work out the details as we go. Ready? Letís get started!

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-2018 by Developer Shed. All rights reserved. DS Cluster - Follow our Sitemap
Popular Web Development Topics
All Web Development Tutorials