ruby-on-railshtmlmanifestoffline-browsing

HTML5 Offline Cache Manifest file with asset pipeline in Rails 3.2 app?


I'd created my first web app using Ruby on Rails. And now, I want to make it offline.

How-to create HTML5 offline Cache manifest file in Rails 3.2 app?

I read some Q&A and articles. They seems outdated. (e.g. Rack-offline?)

.note: e.g. Rack-Offline will output home.js rather than home-234201233453.js

To make use of asset pipeline, I don't want to change settings if possible. (Most articles suggested to disable pre-compile) :-/

Is there any suggestion and tips? (create controller? erb? etc.)

p.s. I'm newbie in development (learn for 1 month only). I understand the html5 manifest mechanism but I'm not sure how to create it in rails


Solution

  • Rack-offline has been updated to work with the asset pipeline in Rails 3.1+. Unfortunately, the maintainer has not bumped the gem version, so simply installing the rack-offline gem won't work for you. In your Gemfile, specify the git repo of the most recent version and you should be good:

    gem 'rack-offline', :git => 'https://github.com/wycats/rack-offline.git'