Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

like image 236
Edditoria Avatar asked Dec 29 '25 21:12

Edditoria


1 Answers

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' 
like image 200
Jason L Avatar answered Dec 31 '25 12:12

Jason L