Backbone app as a Single page app inside Phonegap

I have a rails app with backbone on the client. I am researching the topic of porting the app to iOS with Phonegap.

Two things I am unclear about are (and can’t seem to help myself with google):

  1. I presume, in order for the backbone app to start up on iPhone, I would need a static html page with all js assets packaged. How would I generate the application.js without the md5 hash? Or, how would I include the application-md5…js with a hash into the static page, without updating the link on every build? Or perhaps, I could just have a blank static page that has js to redirect to my rails site, so it loads the backbone assets?

  2. When the app is offline, it would need to store the data in a local store of some kind. What is a convenient way for backbone to use local store when offline and rails backend when online, and sync local data when needed?

Thanks for your help.