Download:
Download(18.8 MB, 10:44)
Alternativer Download für iPod & Apple TV(17.5 MB, 10:44)
Resourcen:
- Episode 199: Mobile Devices
- Let’s Take This Offline – Dive Into HTML5
- rack-offline
- Full episode source code
Quellcode:
[ruby]
# Gemfile
gem "rack-offline"
# config/routes.rb
match "/application.manifest" => Rails::Offline
# config/application.rb
ENV["RAILS_ASSET_ID"] = "" # disable timestamps at end of asset files for offline browsing
# config/environments/development.rb
config.cache_classes = true # to temporarily simulate production
[/ruby]
[html]
<!– layouts/application.html.erb –>
<html manifest="/application.manifest">
[/html]
[javascript]
// application.js
$(function() {
$(window.applicationCache).bind("error", function() {
alert("There was an error when loading the cache manifest.");
});
});
[/javascript]