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

  • Home
  • SEARCH
  • 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 7882407
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T04:16:38+00:00 2026-06-03T04:16:38+00:00

Hi guys I’m pretty stuck with building a customised form in active admin. I’ve

  • 0

Hi guys I’m pretty stuck with building a customised form in active admin. I’ve figured out and even set up my own customised forms using active admin. However I need to create a dynamic form here. This involves making some ajax calls and returning partials of a form for the user to fill out.

It seems that you can create a member action but that is on resources that have been created. In my case I need to create multiple entries on a resource that is yet to be created.

  • 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-03T04:16:39+00:00Added an answer on June 3, 2026 at 4:16 am

    This might get you started. A way could be to add your ajax route to config.routes (just some random example code):

    match '/admin/search/authors' =>  'admin/articles#search_authors',  :via => 'post', :as => :admin_search_authors
    

    Then in the correct register block, in this case in app/admin/articles.rb you can put your controller logic

    ActiveAdmin.register Article do
      ...
      controller do
        def search_authors
          @authors = Author.find_by_query params[:query]
          render :layout => false, :template => 'admin/authors/search'
        end
      end
    
    end
    

    In this case the template just renders an unordered list to be put in the form. Located at app/views/admin/authors/search.html.erb and looks like:

    <ul>
      <% if @authors.count < 1 %>
        <li>None</li>
      <% else %>
        <% @authors.each do |a| %>
          <li>
          <a href="#" onclick="javascript:insert_your_own_voodoo_function_here();return false;">
            <%= raw a.listname %>
          </a>
          </li>
        <% end %>
      <% end %>
    </ul>
    

    Your custom jquery to trigger the ajax-call could look like this, here a delayedObserver is used (thanks to http://code.google.com/p/jquery-utils/wiki/DelayedObserver ):

    $(function() { 
         $('#search_author').delayedObserver(function() {
           $('#search_author').after('<img class="ajax-loader" id="ajax-loader" alt="Ajax-loader" src="/images/ajax-loader.gif">');
           $.ajax({
             url: '<%= admin_search_authors_path %>',
             dataType: 'html',
             type: 'post',
             data: { query: $('#search_author').val(), authenticity_token: $('meta[name=csrf-token]').attr("content")},
             success: function(data) {
               $('.ajax-loader').remove();
               $('#chooseauthor').html(data);
               $("#artikel_edit_auteurs").effect("highlight", {}, 1500);
             }
           });
         }, 0.5);
       });
    

    Anything is possible. Just analyze what you really need: form partials, nested form partials? Depending selects? Maybe you want to build a multiple step form instead. Good luck.

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

Sidebar

Related Questions

Guys, I've came across this problem I can't resolve myselg, I'm pretty sure I
guys, I want to set actions to touches. If people make single touch -
Guys I have been trying lots of different options from cutting up to building
guys. I'm pretty new to both Silverlight and WCF. What I'm trying to do
Guys lease help me out I think I'm close, but I'm missing something. Background
Guys could any one point it out to me a link to web page
Guys, I am using SQL Server 2000 and executing the sp_columns stored procedure to
Guys, what is function called after my class loaded, where i can call self
guys which text editor is good for Rubyonrails? i m using Windows and i
guys please post me an example for threading in MFC....it should show the progress

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.