ActiveAdmin - Custom Javascript only for specific resource, not for any page
activeadmin, customization, javascript, ruby-on-rails
Solution
For me worked following:
form do |f|
text_node javascript_include_tag "path_to/my_javascript_file"
...
Problem
I'm not an ActiveAdmin expert. I need to have a number of customizations on some index pages. As recommended in the documentation, I'm trying to maintain AA pages build and then customize them by using Javascript. I succeeded by putting my own Javascript file under app/assets/javascripts, and then appending ``` //=require my_javascript_file ``` to app/assets/javascripts/active_admin.js The problem is that this way the Javascript code gets loaded for ANY index page of any model. Which is the best way to insert Javascript code only for a specific model? Thanks Thomas