title: Rails Active Admin: How to add a CSV uploader action on dashboard page
body: <p>I am working on a project where I have a CSV uploader class method <code>import_listings(file)</code> which is being called by Sidekiq perform method.</p>
  
  <pre><code>class CsvWorker
  
      include Sidekiq::Worker 
      sidekiq_options retry: false
  
      def perform(file)
          #call import listings class method on the file.     
          imported = Listing.import_listings(file)
          # return true   
      end
  end
  </code></pre>
  
  <p>I am calling the perform_async in a controller action index as shown:</p>
  
  <pre><code>def import
    @imported = CsvWorker.perform_async(params[:file].path)       
  end
  </code></pre>
  
  <p>Everything works great!</p>
  
  <p>I want to move this method on the backend, in the active admin dashboard page. As shown in the figure below. There would be columns for different CSV uploads each with a file upload form :</p>
  
  <p><a href="https://i.stack.imgur.com/JpV5m.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/JpV5m.png" alt="enter image description here"></a></p>
  
  <p>A member action won't be best suited for this task because there is no particular resource. It's a dashboard page. </p>
  
  <p>The code for the dashboard is as below:</p>
  
  <pre><code>ActiveAdmin.register_page "Dashboard" do
  
    menu priority: 1, label: proc{ I18n.t("active_admin.dashboard") }
  
    content title: proc{ I18n.t("active_admin.dashboard") } do
  
      div class: "blank_slate_container", id: "dashboard_default_message" do
        span class: "blank_slate" do
          span "Welcome To Want A Car Buy A Car Backend!"        
          small "Use options below for CSV below:"   
        end
      end
     end # content     
  end
  </code></pre>
  
  <p>The problem is if I try to add a form action in the column like below, it gives me an error saying I can't add inside the column:</p>
  
  <pre><code>columns do
        column do
          panel "CSV Uploads for Dealers" do
            ul do
               form_tag import_listings_path, multipart: true do
                  file_field_tag :file 
                  submit_tag "Import Csv" 
              end
            end
          end
        end
  </code></pre>
  
  <p>My question is: <strong>how can I add a file upload form in these columns, which will call the sidekiq method and pass file params to it? Where to define the method in the dashboard page? There is no controller on the page right? I don't want to add it to the admin resource files. I want it on the dashboard page.</strong></p>