Ruby

  Lab #9: Ruby on Rails  

Rails
Module Customization
How familiar are you with Ruby?
Low  Medium  High 

How familiar are you with AJAX?
Low  Medium  High 

How familiar are you with Rails?
Low  Medium  High 

Objectives

  1. Write basic object-oriented Ruby scripts
  2. Understand AJAX and when to (and not to) use it
  3. Use Rails to develop basic web applications
  4. Utilize Rails' built-in AJAX libraries

Background Material

  1. Introduction

    Provides a brief overview of Ruby, AJAX, and Rails.

  2. Try Ruby!: A Hands-on Tutorial

    A webpage that will let you run ruby interactively on a command line and also walk you through some basic tutorials. A great way to get started with basic Ruby syntax, especially if you prefer to learn by doing.

  3. Programming Ruby - The Pragmatic Programmer's Guide (First Edition)

    The "definitive" guide to Ruby. Excellent reference material, and a great way to learn the language if you prefer to learn by reading.

  4. gotAPI.com

    An excellent API reference for Ruby, Rails, and many other languages.

  5. AJAX overview

    A very basic encyclopedic overview of AJAX - enough to get you comfortable with the term and understand how it fits in with Ruby on Rails.

  6. Rails Weblog Example Screencast

    A .mov screencast demonstrating how to create a very simple Weblog using Rails.

  7. Four Days on Rails

    A tutorial that steps you through the creation of a TODO application. Takes around 2 hours to complete.

  8. Fast-track your Web apps with Ruby on Rails

    Another beginner-level tutorial from IBM that steps your through the creation of an AddressBook.

  9. AJAX on Rails

    A simple tutorial that demonstrates how to use Rails' built-in AJAX libraries.

  10. Rails Reference

    Short, quick reference to basic Rails material

  11. Rails Manual

    Very good reference for figuring out how to do many common tasks within the ruby/rails environment.

  12. HOWTO: Rails @ WPI

    If you do not have your own server to install Rails on, you can actually get it working in your personal WPI webspace. This is a step-by-step guide that I wrote to guide you step-by-step through the slightly-abnormal process of making it work.

Assignment

(to be done Individually)
  1. [1 pt] Install a Rails environment in your AWT webspace or on your own webserver or in a directory on Dreamhost.
  2. [1 pt] Generate a scaffold of a simple, single-threaded (no replies) discussion board with posts that have the following fields: subject, body, author, and date.
  3. [1 pt] Modify your scaffold so that when creating new posts, the date is set automatically by the controller instead of being user/form input.
  4. [0.5 pts] Create an attractive List view for your new rails application, and make posts appear in reverse-chronological order (newest first).
  5. [1.5 pts] Use Rails' built-in AJAX tools to make new posts automatically appear in your list view without refreshing the entire page.
Upload to the File Exchange a text file that contains the URL of your operational discussion board and a TAR or ZIP archive containing your Rails project directory.

Quiz Questions  |   Quiz Solutions  |   Survey
Valid HTML 4.01 Transitional Valid CSS!