I am looking into this myself - generally the idea is that depending on what you want to make available offline you need to setup on the client side (note, this is untested, and hence unverified - I'm just going from my understanding of what I have read - although I am planning on doing some experimentation in the next few weeks...)
In most situations I would recommend setting up standard restful resources with Rails, and then in your client library do something like the following:
- When the page is loaded, determine if Gears has loaded, and if your database is available on the client.
- Create the database if necessary.
- Using the worker process, intialize a call into your RESTful controller to obtain the data you need - and on the return of the data write it into the local database (using the worker process will allow for a 'multi threaded' experience and make sure you dont lock up the client.
- Periodically poll the remote server checking for changes in the data - if needed pull down a fresh set and reload the local data cache.
- When the client is offline switch to using the local client database.
Obviously this is a read-only example, and relies on the existing architecture using AJAX client side calls to populate data in the page etc.
Your means might vary, but I recommend just having a play around - remember you don't have to use Rails plugins etc to do this - you can just roll the client side script by yourself - and you never know, once your done you might be able to refactor your work out into a great little gem or similar...