What is it? =========== Contacts is a sample application that demonstrates the integration of the OpenLaszlo client framework with the Ruby on Rails server framework. Contacts is a Ruby application, one of whose assets is an OpenLaszlo applet that uses REST and AJAX to communicate with the server. Contacts is also a temporary container for the helpers and scaffolding that make it easy to integrate OpenLaszlo and Rails. The Contacts application itself contains very little in the way of OpenLaszlo plumbing. For example, examine the (three-line) implementation of app/controllers/contacts_controller.rb. This provides a subset of the REST services described in http://wiki.openlaszlo.org/Database_Connector to the OpenLaszlo application. Contacts is pre-alpha code. See the "Unfinished Business" section at the end of this README for a description of some of the missing pieces. Requirements ============ * OpenLaszlo 3.1 * Ruby -v of 1.8.2 (25-05-2004) or 1.8.3 * Rails 0.14.2 * MySQL. (You can use PostgreSQL or SQLite if you edit config/database.yml.) Installation ============ 0. Install OpenLaszlo, MySQL, and Ruby on Rails. 1. Set your OPENLASZLO_HOME environment variable to the directory that contains the OpenLaszlo SDK. If the following prints something, you've got it right: > grep Laszlo "$OPENLASZLO_HOME/README.txt" 2. Create a DB named 'contacts', user 'contacts', passwd 'contacts'. If you edit config/database.yaml, you can use different names for all of these. > mysql mysql> CREATE DATABASE contacts; mysql> GRANT ALL ON contacts TO contacts@localhost IDENTIFIED BY 'contacts'; > quit; 3. Set up the database: > rake db_demo_setup 4. Compile the OpenLaszlo application: > rake applets (This may take a while if you've just installed the server. Subsequent compiles are faster.) 5. Start the Rails server: > script/server 6. Browse to the Rails server at http://localhost:3000/contacts/applet. You are now seeing an OpenLaszlo application, compiled to swf, displaying data from a Rails controller. Want to Help or Find Out More? ============ Laszlo on Rails: - Project page: http://wiki.openlaszlo.org/Laszlo_on_Rails - Mailing list: http://groups.google.com/group/laszlo-on-rails Unfinished Business ============ - documentation - unit tests - controller currently always reloads - model should include address, homepage from associates - extend example to exercise C,U,and D - release as a gem and plugin - (separate project) GUI components that make consuming the data easier Credits ============ Oliver Steele http://osteele.com --- Ruby code Geoff Stearns http://blog.deconcept.com/flashobject/ --- FlashObject JavaScript Sarah Allen http://laszlosystems.com --- Contacts demo (client side) Rails team --- Rails Ruby team --- Ruby OpenLaszlo team --- OpenLaszlo