Note that there are some explanatory texts on larger screens.

plurals
  1. PORedundant application.js and css after precompile assets in development with Rail 3.2.3
    primarykey
    data
    text
    <p>I precompile assets before deploy to production. Production mode is work well, but the application.js and application.css redundant in development. I try to <code>rake assets:clean</code> and remove all of the public assets still didn't work. </p> <h1>The view in development</h1> <p>Redundant applicaiton.css and application.js</p> <pre><code>&lt;link href="/assets/application.css?body=1" media="screen" rel="stylesheet" type="text/css" /&gt; &lt;link href="/assets/css/custom-theme/jquery-ui-custom-lastest.css?body=1" media="screen" rel="stylesheet" type="text/css" /&gt; &lt;link href="/assets/animate.css?body=1" media="screen" rel="stylesheet" type="text/css" /&gt; &lt;link href="/assets/jquery_loadmask/jquery_loadmask.css?body=1" media="screen" rel="stylesheet" type="text/css" /&gt; ... &lt;script src="/assets/tags.js?body=1" type="text/javascript"&gt;&lt;/script&gt; &lt;script src="/assets/wedapp.js?body=1" type="text/javascript"&gt;&lt;/script&gt; &lt;script src="/assets/works.js?body=1" type="text/javascript"&gt;&lt;/script&gt; &lt;script src="/assets/application.js?body=1" type="text/javascript"&gt;&lt;/script&gt; </code></pre> <h1>development.rb</h1> <pre><code>config.assets.compress = false config.assets.debug = true </code></pre> <h1>production.rb</h1> <pre><code>config.serve_static_assets = false config.assets.compress = true config.assets.compile = true config.assets.initialize_on_precompile = false config.assets.digest = true config.action_dispatch.x_sendfile_header = 'X-Accel-Redirect' # for nginx </code></pre> <p>Now, I need to set false in config.assets.debug at development.rb, but I can't debug assets before precompile. This's really bother me. </p> <p>Any suggestions? thanks.</p> <h1>Solution</h1> <p>Try to change application.js file anything, I delete one blank line and <code>rake assets:clean RAILS_ENV=development</code>, it works well now.</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload