User Tools

Site Tools


eg-259:practicals:4

Web Applications Development with Ruby on Rails

Introduction

Please note: These screencasts were created using an earlier version of Rails. There have been changes to the system since these were made. In particular, Part 3 and Part 5 will not work for you. If I have time to upgrade them, I will eventually replace these sections. In the mean time, check out Rolling with Rails 2.0 and the excellent Railscasts series.

In the following scenario I will take you through the development of a three-tier Web Database application in Ruby on Rails. I start with the minimum necessary tools. Nearly all the tools you need for Ruby on Rails application development, including a suitable Ruby/HTML editor, come with the Ruby installation. All you need in addition is a suitable database management system. I used the version of MySQL (version 5.0.45) that comes with my installation of Apache Friends XAMPP (Version 1.6.4 for windows). This comes with phpMyAdmin (Version 2.11.1), a useful web-based MySQL client.

Ruby on Rails comes with its own web server which is suitable for development. Thus you do not need the Apache web server unless you actually want to deploy a Ruby on Rails application.

If you want an even quicker quickstart, you can use the new RailsInstaller from Engine Yard. This includes everything you need to get a Rails 3 development environment working on a Windows machine. It includes the source code version control tool Git, which is a standard in the Rails community, and a free trial on the Engine Yard cloud service. The useful introductory video illustrates installing Rails 3, using GitHub for code hosting and the Engine Yard cloud service for deployment. If you use the Rails installer, you can skip straight on to Part 3.

About these Screencasts

The following Web Development Scenarios are presented in the form of screencasts. That is a set of recordings of a development session taken live from my PC complete with a running commentary and converted to Shockwave Flash. The sessions are presented here in a form suitable for viewing online. The same sessions are provided in the Compressed Folder for the lecture that will be available after the lecture. If you download and unpack the lecture and the examples, you'll find the screen casts in the folder ../lecture20/screencasts. The database schema used in the example is to be found in the file ../lecture20/database/cars.sql.

If you are interested, the screencasts were created with the open-source program Debug Mode Wink, which is available for free download for most platforms.

Part 1: Installing Ruby

In this first of five screencasts I show you how Ruby is obtained and installed on a PC Windows platform.

Part 2: Installing Rails

The second of five screencasts on the development of a web application with Ruby on Rails. Having successfully installed Ruby, this screencast takes you through the steps needed to install Rails itself. Note that for Ruby for windows, the default database sqlite3 is not included. You need to download and install it before the default application configurations will work (follow these instructions).

Part 3: Hello Rails!

This screencast, the third of five, shows you how to create your first rails application. It also demonstrates the relationship between URLs and controllers (Ruby's implementation of the Page Controller pattern) and controller actions (Ruby methods).

Part 4: Creating the Cars Database

This screencast, the fourth of five, shows you how to create a database for the Rails web application. Rails uses a feature that assumes certain defaults in the naming of tables, fields and primary keys. We shall point these out in the presentation.

Part 5: Creating the Cars Application

This fifth and final screencast in the series on Web Applications Development using Ruby on Rails shows you how we can link the database created in Part 4 to the web. The presentation demonstrates how Rails' support for useful defaults can make trivial the creation of an outline CRUD application based on the Model-View-Controller pattern. We'll also see that Rails uses another software design pattern called Active Record to tie models, represented by Ruby classes, to the database tables. It also provides a feature called scaffolding that automatically creates controllers and views (web pages) used to connect models to the web.

—-

home | Lecture 20

eg-259/practicals/4.txt · Last modified: 2011/05/08 14:54 by eechris