Take Home Exam: login to a Windows system on which Ruby on Rails has been installed. Note: to make sure that you will encounter no problems with obsolete versions, verify that your system is running Ruby 1.9.2 and Rails 3.0.3.
Download and extract the ZIP file exam4.zip, which contains an incomplete Rails webapp. You should be sure to place this folder into a suitable location for developing and running Rails webapps.
Try running this webapp as it is. You should verify that its home page displays four buttons (Up, Down, CCW, CW). As you probably have guessed, CCW and CW denote counterclockwise and clockwise respectively. This group of buttons acts as a handpaddle for controlling some movable object, such as a telescope. As you should also verify, pressing any of these buttons produces an appropriate status message in the textbox below.
However, in its present form these messages are simply produced by client-side JavaScript functions, all of which have been added to a file named application.js in the folder exam4/public/javascript. (This is a standard place for adding application-specific JavaScript code.) So at present the server is not informed about events on any of these buttons.
Your mission for this exam is to add Ajax functionality to this Rails webapp, so that a matching request is sent to the server whenever any one of these buttons is pressed or released. In each case the server must respond by sending the same message that is now displayed directly by the Javascript functions on the client side. In your finished version, the status box must show each server response.
Some helpful hints: you will need to edit the home-page controller, the configuration file config/routes.db, and the JavaScript file public/javascripts/application.js to make these things happen. Also, since several aspects of the textbook discussion of Ruby with Ajax in Chapter 15 seem to be out of date already, you should feel free to use the same sort of Javascript coding for Ajax that you saw in Chapter 10. For help on all these matters please feel free to consult with your kindly instructor, but no one else.
A zipfile of your completed project must be uploaded to your Linux csci/344/exams folder by 5:30 pm Thursday, April 28.