Class: AppcacheManifestGenerator

Inherits:
Rails::Generators::NamedBase
  • Object
show all
Defined in:
lib/generators/appcache_manifest_generator.rb

Instance Method Summary collapse

Instance Method Details

#create_appcache_manifestObject



3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
# File 'lib/generators/appcache_manifest_generator.rb', line 3

def create_appcache_manifest
  create_file "app/views/rails_appcache/manifests/#{file_name}.appcache.erb", "CACHE MANIFEST\n\n# auto-expire appcache in dev\n# <%= appcache_version_string %>\n\nCACHE:\n# by default, only the root path is cached\n/\n\n# Cache additional paths by using path helpers:\n# <%= posts_path %>\n\n# Cache our JS/CSS bundles\n<%= stylesheet_cache_path '\#{file_name}' %>\n<%= javascript_cache_path '\#{file_name}' %>\n\n# Cache additional assets by using the asset_cache_path, or any of the Rails built-in asset pipeline helpers\n# <%= asset_cache_path 'logo.png' %>\n# or\n# <%= asset_path 'logo.png' %>\n\n# Make everything else accessible\n# WITHOUT THIS LINE, your browser will 404 for anything not explicitly listed under CACHE:\nNETWORK:\n*\n" 
end