Replies: 4 comments 15 replies
-
AFAICT there is no built-in way at the moment, leaving only questionable options: monkey patchingImportmap::ImportmapTagsHelper.prepend(Module.new do
def javascript_importmap_tags(entry_point, ...)
return super unless entry_point.to_s == 'active_admin'
safe_join([super, YOUR_JS], "\n")
end
end) overriding the views
|
Beta Was this translation helpful? Give feedback.
-
@javierjulio Can we add some documentation on adding custom Javascript using the active admin importmap? The documentation on the web about how to do this with a rails engine is somewhat lacking. Currently I'm doing this (which isn't the right way I'm sure).
What I really want to do is:
This seems like it should be doable but as I say, documentation around import camps in general is quite hard to come by. I would be happy to add a PR for documentation if I knew the "right" way to do this. Cheers |
Beta Was this translation helpful? Give feedback.
-
At this point using importmap has no benefits compared to bundling |
Beta Was this translation helpful? Give feedback.
-
I solved it like this: https://stackoverflow.com/questions/78985376/activeadmin-v4-how-to-add-custom-js-via-importmaps/78985377 |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
I'm trying to add custom javascript, such as is needed for this addon
https://github.com/blocknotes/activeadmin_quill_editor
How do I do it? I've tried creating an
active_admin.js
but it is not being loaded.Beta Was this translation helpful? Give feedback.
All reactions