title: "Failed to load resource" errors for .js and .css files when running Rails application offline in development environment
body: <p>I'm trying to get a Rails application to work offline. The application appears to work OK when online.</p>
  
  <p>In Chrome, when the server is running, I see this from the Chrome console when I run the application (portions snipped). :</p>
  
  <pre><code>Document was loaded from Application Cache with manifest
  http://localhost:3000/application.manifest
  Application Cache Checking event
  Application Cache Downloading event
  ...
  Application Cache Progress event (5 of 16) http://localhost:3000/assets/todos.css.scss
  Application Cache Progress event (6 of 16) http://localhost:3000/assets/application.css
  Application Cache Progress event (7 of 16) http://localhost:3000/assets/todos.js.coffee
  Application Cache Progress event (8 of 16) http://localhost:3000/assets/jquery.tmpl.js
  Application Cache Progress event (9 of 16) http://localhost:3000/assets/jquery.offline.js
  ...
  Application Cache Progress event (11 of 16) http://localhost:3000/assets/jquery.js
  ...
  Application Cache Progress event (13 of 16) http://localhost:3000/assets/json.js
  Application Cache Progress event (14 of 16) http://localhost:3000/assets/scaffolds.css.scss
  Application Cache Progress event (15 of 16) http://localhost:3000/assets/application.js
  Application Cache Progress event (16 of 16) 
  Application Cache UpdateReady event
  </code></pre>
  
  <p>However, offline I see this (again, some snipped). Note that the <code>GET</code> lines are load errors.:</p>
  
  <pre><code>Document was loaded from Application Cache with manifest http://localhost:3000/application.manifest
  Application Cache Checking event
  GET http://localhost:3000/assets/application.css?body=1  todos:5
  GET http://localhost:3000/assets/scaffolds.css?body=1  todos:6
  GET http://localhost:3000/assets/todos.css?body=1  todos:7
  GET http://localhost:3000/assets/jquery.js?body=1  todos:8
  GET http://localhost:3000/assets/jquery_ujs.js?body=1  todos:8
  GET http://localhost:3000/assets/jquery.offline.js?body=1  todos:8
  GET http://localhost:3000/assets/jquery.tmpl.js?body=1  todos:8
  GET http://localhost:3000/assets/json.js?body=1  todos:8
  GET http://localhost:3000/assets/offline.js?body=1  todos:8
  GET http://localhost:3000/assets/todos.js?body=1  todos:8
  GET http://localhost:3000/assets/application.js?body=1  todos:8
  Application Cache Error event: Manifest fetch failed (-1) http://localhost:3000/application.manifest
  </code></pre>
  
  <p>In particular, I notice <code>?body=1</code> is appended to the file name when offline.</p>
  
  <p><strong>Environment:</strong></p>
  
  <ul>
  <li>Rails: 3.2.8</li>
  <li>ruby 1.9.3p194</li>
  <li>WEBrick: 1.3.1</li>
  <li>MySQL: 5.5.28 MySQL Community Server</li>
  <li>Chrome: Version 22.0.1229.94 m</li>
  <li>OS: Windows 7 Enterprise version 6.1 (Build 7601: Service Pack 1)</li>
  </ul>
  
  <p><strong>Gems</strong> (the gems I think are relevant):</p>
  
  <ul>
  <li>jquery-rails (2.1.3)</li>
  <li>json (1.7.5, 1.5.4)</li>
  <li>rack-offline (0.6.4)</li>
  <li>sprockets (2.1.3)</li>
  </ul>
  
  <p><strong>Application Manifest</strong>:</p>
  
  <pre><code>CACHE MANIFEST
  # ef05db1f746b226b3eb8b3673d65d3585eb8a9e1e35f79a6fc9d90693ff9a569
  404.html
  422.html
  500.html
  index.html
  assets/application.js
  assets/jquery.js
  assets/jquery.offline.js
  assets/jquery.tmpl.js
  assets/json.js
  assets/todos.js.coffee
  assets/application.css
  assets/scaffolds.css.scss
  assets/todos.css.scss
  
  NETWORK:
  /
  </code></pre>
  
  <p><strong>application.html.erb</strong>:</p>
  
  <pre><code>&lt;!DOCTYPE html&gt;
  &lt;html manifest="/application.manifest"&gt;
  &lt;head&gt;
      &lt;title&gt;TestOffsite&lt;/title&gt;
      &lt;%= stylesheet_link_tag    "application", :media =&gt; "all" %&gt;
      &lt;%= javascript_include_tag "application" %&gt;
      &lt;%= csrf_meta_tags %&gt;
  &lt;/head&gt;
  &lt;body&gt;
  
  &lt;%= yield %&gt;
  
  &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p><strong>todos_controller.erb</strong> (snipped):</p>
  
  <pre><code>class TodosController &lt; ApplicationController
    # GET /todos
    # GET /todos.json
    respond_to :html, :json   
  
    def index
      @todos = Todo.all
  respond_with(@todos)
      #respond_to do |format|
      #  format.html # index.html.erb
      #  format.json { render json: @todos }
      #end
    end
  ...
  </code></pre>
  
  <p><strong>Contents of manifest.yml</strong>:</p>
  
  <pre><code>---
  rails.png: rails-be8732dac73d845ac5b142c8fb5f9fb0.png
  application.js: application-39fb9cbdc400e6885a41059ea60f3851.js
  application.css: application-0149f820dbdd285aa65e241569d8c256.css
  </code></pre>
  
  <p>Any help is much appreciated.</p>