1

正在使用active_admin,它的效果很好。主動管理有很多依賴像jquery-ui, datepicker etc..防止活動管理資源加載到非active_admin頁面上

<script src="/assets/active_admin/jquery_ui.self-75a11da44c802486bc6f65640aa48a730f0f684c5c07a42ba3cd1735eb3fb070.js?body=1" data-turbolinks-track="reload"></script> 
 
<script src="/assets/active_admin/base.self-ab2cb3098b53fe7d229937d768d701e8f4013f2a5aea7988d8f2149fa40426db.js?body=1" data-turbolinks-track="reload"></script> 
 
<script src="/assets/active_admin/lib/batch_actions.self-fbed82dc1e31cf860056cce6c02f5bc5831ad5343d68ac3ab17471c9e05e9195.js?body=1" data-turbolinks-track="reload"></script> 
 
<script src="/assets/active_admin/lib/checkbox-toggler.self-ab6f686db7db58fd7f370cd6f7a6d7abe6884b8d2a144f42a744c2276587b457.js?body=1" data-turbolinks-track="reload"></script> 
 
<script src="/assets/active_admin/lib/dropdown-menu.self-8ccb356121a1c40094bb429d6cfac85d9c8ad114fb93730892d9df9986730a0a.js?body=1" data-turbolinks-track="reload"></script> 
 
<script src="/assets/active_admin/lib/flash.self-8f05a5d9328ea28fca100b057787fbfb567986513c5f1735ea48fad8f9571c10.js?body=1" data-turbolinks-track="reload"></script> 
 
<script src="/assets/active_admin/lib/has_many.self-ece319debdc01ca5096ae8ac6c130ffc0decab382543b4b94e18591375d3d3bb.js?body=1" data-turbolinks-track="reload"></script> 
 
<script src="/assets/active_admin/lib/modal_dialog.self-5dfc6e87bae26cd4a021eb86951d3691ed07e6d2bf242a8eb65dc6965e12096c.js?body=1" data-turbolinks-track="reload"></script> 
 
<script src="/assets/active_admin/lib/per_page.self-94323c49402595a22bdea01b8dc3f8103e290d300238ebd49efa26d76d7ee117.js?body=1" data-turbolinks-track="reload"></script> 
 
<script src="/assets/active_admin/lib/table-checkbox-toggler.self-f5200d732ec9ffd4ee8fd1fe11524ad7b54a67f6c0ef447a29d119ece2dcecdb.js?body=1" data-turbolinks-track="reload"></script> 
 
<script src="/assets/active_admin/ext/jquery-ui.self-f96f2ec2a32c4bc4da4292cc74bddeca0bb223d81a421c98c4d613632860945e.js?body=1" data-turbolinks-track="reload"></script> 
 
<script src="/assets/active_admin/ext/jquery.self-da8dafbbe883092bcae73f35a8caf4ae6170fe7d8130ae7039a233f9b509c757.js?body=1" data-turbolinks-track="reload"></script> 
 
<script src="/assets/active_admin/initializers/batch_actions.self-f5c360e8640b40f00640f6e5c7cfe0addeb244ed72e1a9828c52919515d23cf1.js?body=1" data-turbolinks-track="reload"></script> 
 
<script src="/assets/active_admin/initializers/datepicker.self-f8ac66c85afd35ee1555c09a2418efc7a7930e1f6dd783461379c2bb2184f80e.js?body=1" data-turbolinks-track="reload"></script> 
 
<script src="/assets/active_admin/initializers/filters.self-9b9312d6bed532db668c5417a009b7fb7caf58f33299783ed02c2c72340a498a.js?body=1" data-turbolinks-track="reload"></script> 
 
<script src="/assets/active_admin/initializers/tabs.self-65de8b1688d4f8782c04bf07ba6314d3c8b33b9391a482a07214ac4df99dd904.js?body=1" data-turbolinks-track="reload"></script> 
 
<script src="/assets/active_admin.self-877aef30ae1b040ab8a3aba4e3e309a11d7f2612f44dde450b5c157aa5f95c05.js?body=1" data-turbolinks-track="reload"></script>

我不是在我的應用程序使用這些在任何其他地方。但是我可以看到,無論活動管理頁面是否加載它都會加載。那麼是否有可能只爲活動管理頁面加載這些資源? (如果不可能,可以從asset pipeline刪除活動管理員,以便不會加載依賴項other app parts)?

回答

1

您能否從application.js 中刪除 //= require_tree .並重試?