我已经接管了正在从3.2升级的Rails应用程序。问题在于资产花费的时间太长。
更新: 这个问题正在开发中。
这是base_theme.js文件
//= require jquery
//= require jquery_ujs
//= require jquery-ui
//= require jquery.fileupload
//= require legacy.jquery.iframe-transport
//= require jquery.color
//= require jquery.Jcrop
//= require jquery.mask
//= require jquery.mb.YTPlayer.min
//= require history.adapter.jquery
//= require history
//= require bootstrap.min.js
// require bootstrap
//= require affix
//= require scrollspy
//= require webcam
//= require onfido.min
//= require ce-compliance-action-invest
//= require ce-compliance-investment-slider
//= require ce-investment-fee-calculator
//= require ce-direct-uploads
//= require ce-image-processor
//= require ce-country-states
//= require ce-modal
//= require ce-camera
//= require ce-session-timeout
//= require ce-project-duplicator
//= require payment_methods
//= require projects
//= require test_the_waters_project
//= require base-script
//= require Chart
//= require social-share-kit.min
//= require tinymce-jquery
//= require jquery_nested_form
//= require md-slider.min.js
// require tabs
//= require ckeditor/init
//= require ckeditor/config
//= require front-end-validation-helper
//= require jquery.validate.min.js
//= require jquery.bootstrap.wizard
//= require vimeo-player
//= require bs-wizard
//= require rewards-checkout-validation
//= require mask_and_reveal.js
//= require team_members.js
应用程序中包含很多液体,因为它几乎没有真正的Rails Way™视图。不仅仅是其他页面上的javascript文件,它无法加载到style_sheet_tag
上。
我不确定是否缺少Rails 4.x弃用gem或资产配置的步骤。下面是来自application.rb文件的
更新: 就像我说的,这个应用程序在下面的代码行中可以解决这个特定问题。在其他时候,这不是在执行render_to_string,而且奇怪的是render_to_string来自WickedPDF。
@compressed_js = render_to_string partial: 'application/compressed_js_assets'