2

ActiveAdmin では、ダッシュボードで action_item を押したときにフォームから値を取得しようとしていますが、これを行う方法が正確にはわかりません。さまざまなメソッド呼び出しにパラメーターを渡すことができます。

    ActiveAdmin.register_page "Dashboard" do

  menu :priority => 1, :label => proc{ I18n.t("active_admin.dashboard") }

  page_action :scrape, :method => :post do
    #The scraper works, but I don't know how to pass the info
    #from the form from below into this method
   # scrape = Scraper.new
   # scrape.scrape
    redirect_to admin_dashboard_path, :notice => "Ran the scraper!"
  end

  action_item do
    link_to "Run Scraper", admin_dashboard_scrape_path, :method => :post

  end
    content :title => proc{ I18n.t("active_admin.dashboard") } do
      panel  "Run Course Scraper" do
        para "Run the course webscraper to pull current class list and insert into the Course table in the database"
        form do |f|
          f.input "Session"
        end

      end
    end
end

session を page_action :scrape に渡すというフォームから入力フォームを取得したいのですが、何かアイデアはありますか?

4

1 に答える 1