Shadowfiend / gwt-on-rails forked from digitaria/gwt-on-rails

A port of the hibernating http://code.google.com/p/gwt-on-rails/ : The mission is to update gwt-on-rails to gwt1.6/rails2.3.2

This URL has Read+Write access

commit  0a6fb8a3fa0a89b9521a135ab52478444224628d
tree    878629e6b34e77633020c1ef1fc1c5d1d750541b
parent  1d81b9c75310c5efeba965e49630afffd6c4ec5e
README
GWT on Rails
-------------------------------------------------------------------------------
Copyright (c) 2007, 2008 Jon Crosby, released under the MIT license.
http://code.google.com/p/gwt-on-rails/
-------------------------------------------------------------------------------

-------------------------------------------------------------------------------
Bundled GWTx module is Apache 2.0 licensed and authored by Sandy McArthur.
http://code.google.com/p/gwtx/
-------------------------------------------------------------------------------

GWT on Rails integrates GWT client side compiled JavaScript development
with Rails REST web services by providing four things:

1) A GWT client generator
2) A GWT model generator
3) An ActiveRecord extension to keep GWT models in sync with ActiveRecord models
4) The GWT-REST module (see http://github.com/digitaria/gwt-rest and http://code.google.com/p/gwt-rest/)

-------------------------------------------------------------------------------
Using the Client Generator and Rake Support
-------------------------------------------------------------------------------

To build a JavaScript REST client for your app using GWT, do the
following:

1) Download GWT from http://code.google.com/webtoolkit and set a $GWT_HOME
   environment variable that points to it's location on your file system.

2) Generate the client, passing along the desired GWT project name:
> script/generate gwt_client dashboard

3) Compile it:
> rake dashboard:compile

4) Test it in "Hosted Mode" (see GWT docs for more on this):
> rake dashboard:hosted

From this point forward, you can click the "Refresh" button in the Hosted Mode
browser to recompile updated Java code.

The above steps will generate a "gwt" tree under RAILS_ROOT/app that will house
all GWT clients for your Rails application. Compiled JavaScript output will
appear under public/gwt and follows the Java/GWT convention of requiring a
package for each class (i.e. "dashboard" is housed in "dashboard.Dashboard").

-------------------------------------------------------------------------------
Using Migrations to Manage GWT Client Resources/Models
-------------------------------------------------------------------------------

To use an ActiveRecord "Project" model on the client side, do the following:

1) Generate the GWT model/resource by passing in the name of the ActiveRecord
   model and the desired GWT project name:
> script/generate gwt_resource Project dashboard

2) Sync it
> rake db:migrate

The above will produce two classes, Project and ProjectBase in the "resources"
package of your GWT client tree. ProjectBase matches your ActiveRecord model
and will be regenerated with each migration. Project extends ProjectBase and
can thus be used to hold custom code.

-------------------------------------------------------------------------------

The use of GWT-REST to manage collections of resources on the client side will
be documented as part of the independent GWT-REST Google Code project:

http://github.com/digitaria/gwt-rest
http://code.google.com/p/gwt-rest/

-------------------------------------------------------------------------------
Using Eclipse with gwt-on-rails
-------------------------------------------------------------------------------
In Eclipse:
* Create a new GWT 1.7 web application in eclipse. Do not include the Google App Enging plugin.
* Edit the build path to include the rails source,  output directories, and gwt-rest jars:
** Right-click on your new project. Select Properties -> Java Build Path
** "Link Source" -> RAILS_APP/app/gwt/order_dashboard/src
** "Link Source" -> RAILS_APP/app/gwt/order_dashboard/lib/
** "Link Source" -> RAILS_APP/public/gwt/
** Click Ok to apply and close properties.
** Right-click on lib/gwt-rest.jar -> Build Path -> Add to build path

-------------------------------------------------------------------------------
Developing gwt-on-rails apps
-------------------------------------------------------------------------------
* Start the rails server
* In a separate terminal, navigate to RAILS_APP and start your GWT app in hosted mode
** rake order_dashboard:hosted
* Continue to edit in Eclipse (or any other editor like emacs) and simply refresh to reload GWT source.
* You can now run your GWT app