AJAX / RoR Experience - Cassidy Pangell
Ruby on Rails
Sayings Project:
Created a database of sayings that stored at least 3 fields (eg phrase, author, category) which included at least 2 types of validation. In my validation method, I used a hash table to contain the valid entries, then used the include? method of the hash table to check the user entry. I used the hash to_sentence method to format my error message. The index sorted each phrase in a different color.
Campaign Project:
Use AJAX for mailings. In the last lab you created a mailings application that allowed users to select donors. The donors appeared in the sidebar, but not using AJAX. In this lab you will convert that code to use AJAX for the cart display. The "Finish Mailing" button takes the user to a view that allows the entry of two fields: the person sending the mailing and the message to send. The messages are loaded from the database into a combo box.
Implemented a "Send Mailing" button that updates two tables. One table should be used to store the data for the mailing, which should include the date sent (get from Time.now), the person sending the message and the message id being sent. I called this model Correspondence. The second table is an association table that captures the association between the mailing and the donors included in the mailing. I called this model DonorItem. This table included a correspondence id and a donor id.
After a mailing is sent, the cart is emptied. To verify that the item has been stored to file, added a flash message as confirmation, using data from the database. The message displayed the date, person and number of donors in the last correspondence.
![]() |
![]() |
![]() |
AJAX
Yahoo Maps Project:
Included two text fields. The first is the location auto-suggest field. The second is a larger text field that will display the associated address OR allow the user to enter an address.
As the user types into the location field, suggestions will be displayed. When the user presses Enter, the address will be looked up and the associated map will be displayed.
The user may choose instead to type an address directly into the Address field. When the user presses Enter in that field, the associated map will be displayed.
Updated the .sql files so that the FavoriteLocations table includes an address for each name. Updated the data so that each location has an address. The Yahoo drawZoomAndCenter method can take an address as well as a YGeoPoint.
![]() |