Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8875493
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T18:59:14+00:00 2026-06-14T18:59:14+00:00

I use active admin and in my app there are different .js that must

  • 0

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 &copy; #{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

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-14T18:59:15+00:00Added an answer on June 14, 2026 at 6:59 pm

    I’m using master branch of ActiveAdmin 0.5.0 (as of 23 Nov 2012) and there is a Arbre builder method within which is working for me.

    show do 
       within @head do
          script :src => javascript_path('somefile.js'), :type => "text/javascript"
       end
    end 
    

    You can see an example of its use in ActiveAdmin::Views::Pages::Base#build_active_admin_head.

    Hope this helps.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

In my rails app i use active admin, now i have such model (only
I am attempting to use active admin with a project. This project also uses
I have a non-rails application that I want to use rails active-record migrations with.
MySQL uses the USE database_name to change the active database. Does that work on
I'm planning to use the following to add subnets to Active Directory Sites. We
I'm new to Rails and I want to use Active Admin on my first
I am writing an app that needs to use a third party ocx control.
Active Admin says you can change the site title this way: Site Title Options
Active Admin allows me to define filters that are displayed on the index page
This is similar to my previous question Ruby On Rails Active Admin has_many changing

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.