ruby on rails - How do I force rake assets:precompile to generate a separate JS file for production RefineryCMS? -
i'm using refinerycms , in admin section need include js file. have set config value
config.register_javascript "bootstrap.modal"
http://antonivanopoulos.com/refinerycms-admin_restyle-a-gem-to-make-refinery-cms-a-little-prettier/
it works in development. when precompile assets production, refinerycms admin pages give 404 error because bootstrap.modal-7bc4667810e04a7a7ccf02099c81a882.js
doesn't exist in public/assets. instead it's embedded in application.js
refinery admin doesn't use.
refinery insert separate js tag file:
<script src="/assets/bootstrap.modal-b7d8ffab93a0b4c1ed4d9681ec6647f4.js" type="text/javascript"></script>
the file exists app asset, doesn't fingerprinted own file.
$ ls app/assets/javascripts/bootstrap.modal.js app/assets/javascripts/bootstrap.modal.js $ rake assets:precompile ... $ ls public/assets/boot* ls: cannot access public/assets/boot*: no such file or directory
i can't include application.js because there lot more stuff messes display of admin pages.
i read entire asset pipeline guide found nothing useful.
http://guides.rubyonrails.org/asset_pipeline.html
rails 3.2.14.
i found can add individual files list of assets compile files in production.
production.rb:
config.assets.precompile += %w( bootstrap.modal.js bootstrap.modal.css blog_post_form.js ) # refinery admin /config/initializers/refinery/core.rb
Comments
Post a Comment