I use active admin and in my app there are different .js that must be loaded in specifics pages (not all).
Following this topic Best way to add page specific javascript in a Rails 3 app? it appears to be easy, but the layout in active admin is compiled.
I have used a workaround to overwrite the footer:
class ActiveAdmin::Views::Pages::Base < Arbre::HTML::Document
private
# Renders the content for the footer
def build_footer
div :id => "footer" do
para "Copyright © #{Date.today.year.to_s}- All rights reserved ".html_safe
end
end
end
How can I add some .js in the header of some pages? How with a workaround? (if possible with a "yield :head" or something like that, so I can call it easier from everywhere ;))
EDIT NOTE: the js that i want to include render a highcharts