activeadmin icon indicating copy to clipboard operation
activeadmin copied to clipboard

Add options for registering javascripts.

Open lanzhiheng opened this issue 4 years ago • 1 comments

I have replace the turbolink with turbo in my project. so I think it will be better to generate <script> tag like below

<script src='assets/admin.js' data-turbo-track='reload'></script>

However, the method register_javascript don't support options like config.register_stylesheet

I think it will be a good idea to make it customizable

config.register_stylesheet 'active_admin.css', media: 'screen', 'data-turbo-track': 'reload'
config.register_javascript 'active_admin.js', 'data-turbo-track': 'reload'

lanzhiheng avatar Jun 04 '21 13:06 lanzhiheng

Would love to get this one loaded as hotwire becomes more readily used.

nitsujri avatar Nov 15 '21 03:11 nitsujri

Codecov Report

Patch coverage: 100.00% and no project coverage change.

Comparison is base (d4cd830) 99.01% compared to head (04f5a65) 99.01%.

Additional details and impacted files
@@           Coverage Diff           @@
##           master    #7002   +/-   ##
=======================================
  Coverage   99.01%   99.01%           
=======================================
  Files         197      197           
  Lines        4950     4950           
=======================================
  Hits         4901     4901           
  Misses         49       49           
Impacted Files Coverage Δ
lib/active_admin/asset_registration.rb 100.00% <100.00%> (ø)
lib/active_admin/engine.rb 100.00% <100.00%> (ø)
lib/active_admin/views/pages/base.rb 100.00% <100.00%> (ø)

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Do you have feedback about the report comment? Let us know in this issue.

codecov[bot] avatar May 11 '23 02:05 codecov[bot]