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 7085497
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T07:25:54+00:00 2026-05-28T07:25:54+00:00

I just implemented the ActiveAdmin gem with my Rails 3.1 app, and it caused

  • 0

I just implemented the ActiveAdmin gem with my Rails 3.1 app, and it caused a problem with some javascript I have in my app which allows ajax posting of comments. Removing the active_admin.js file causes the problem to go away. How do I keep the active_admin’s javascript while preserving the functionality of my app? Any ideas on what the problems may be?

Contents of active_admin.js:

//= require active_admin/base

Contents of my application.js file:

//= require jquery
//= require jquery_ujs
//= require_tree .

Javascript that is being broken by ActiveAdmin:

jQuery -> 
$('.addcomment').live("click", ->
 $(this).closest('.comment_area').find('.add_comment_box').parent().removeClass("add_comments_box_hidden").addClass('add_comments_box')
    return false )

init_csrf = ->
  window._settings.token = $('meta[name="csrf-token"]').attr 'content'
  $.ajaxSetup
    beforeSend: (xhr) ->
      xhr.setRequestHeader "X-CSRF-Token", _settings.token

jQuery ->
    $('.post_comment_btn').live("click", ->
        $(this).closest('.comment_area').addClass('add_comment_here')
        $.post(
            '/comments'
            $(this).closest('form').serialize()
            null
            "script"
        )
        return false )

Link to active_admin github page.

  • 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-05-28T07:25:55+00:00Added an answer on May 28, 2026 at 7:25 am

    I don’t know if this will help you … I’m also using active_admin’s javascript separately from the active_admin app. I faced a problem with double requests on clicking to “ajax links”. The problem was caused by triggers in the vendor.js file. This has been fixed with the latest version of the gem (vendor.js has been removed) and proper inclusion statements in my application.js file.

    I would suggest you to replace //=require_tree . with explicit require statements. Try one by one to add your deps till you find the problem.

    Moreover, please provide us with the version of ActiveAdmin that you are using.

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

Sidebar

Related Questions

I have just implemented WMD for my editor in an ASP.NET app. The problem
I am developing a Silverlight app using VS2008 Express. I have just implemented a
I have just implemented Flurry into my iPhone app. My app is targeting a
I have just implemented Facebook Authentication on my website using Facebook JavaScript. If user
I have just implemented some classes: public abstract class Job<T extends ViewerUnion>{ [...] }
I have just implemented an Ajax File Upload control that uses a progress bar.
I've just implemented iAds in an app with several distinct UIViewControllers. I have the
I just implemented the onClickListener. The App should switch between two layouts. On each
I've just implemented SQLCipher in my app to encrypt one fairly simple database. I
I've just implemented some code that emails a bunch of our clients with a

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.