Ruby on Rails

Architecture

Rails is a Ruby program; any server which can call the Ruby interpreter can run Rails.

Rails is based on a Model, View, Controller pattern.

Model
A class representing a business object, with methods for the business logic.
View
A template, with embedded Ruby code, which renders a view of the model.
Controller
A class which maintains the model, processes client requests, and despatches the correct view.

State

Rails encourages the use of a database for all data (through its ActiveRecord object relational mapper), but there is also a session hash available. As stated in the requirements, this application does not make any use of a database, so the model is held in the session.

Source Files

app/controllers/App_controller.rb
This is the controller for the App directory. By default, all requests of type /App/A will be handled by AppController.A, defined in App_controller.rb.
app/models/Name.rb
This is the model; a simple Ruby class defining the data object and access methods.
app/views/app/A.rhtml
The Ruby HTML template for page A.
app/views/app/B.rhtml
The Ruby HTML template for page B.
app/views/app/C.rhtml
The Ruby HTML template for page C.

Deployment

All the source files can simply be copied to the web server. For more complex scenarios, there are third party tools to handle deployment.

Tools

Rails comes with a number of console tools for generating the initial directory structure and boilerplate. The two used here were rails, which generates the directory structure and files for an empty site, and the default generator, to create a controller and view directory. All the source for the files listed in Appendix D was written from scratch. Aptana was used as an IDE, but no features other than the text editor were utilised.