Search code examples
ruby-on-rails-3htmlofflinelawnchair

Rails 3 offline web app storage and sync


I'd like to use rails 3 to develop mobile apps that will be able to work offline and sync back as soon as the network is available.

I found lawnchair which seems promising for storing/syncing because it is pure json.

Is there a way or design pattern with which I can activate Lawnchair if rails 3 app is offline and then sync lawnchair data back with rails 3 app once it is online again?

Can rack-offline be used to trigger this behaviour?


Solution

  • This is what I'm doing right now:

    1. I'll use the Rails 3 app as a JSON API
    2. The front end will be managed by Backbone.js which I find to be "good" which to me means that when I first had a chance to look at how it worked it gave me the same good impression as Rails did
    3. The storage part will be held by HTML5 localStorage and then synced back through JSON with the Rails API (when offline)

    My training stuff for all this are as follows:

    1. HTML5 Client Side Caching
    2. Backbone.Js on Rails

    Let me know different options/paths