Question

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

Was it helpful?

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' 

OTHER TIPS

The gem hasn't been updated, but there is a fork that has one commit that enables Rails4 support:

https://github.com/pascalw/rack-offline/tree/rails4-support

gem 'rack-offline', :github => 'pascalw/rack-offline'

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top