0
私はそうとProspectReviewためactive_adminフォームを持っている:別のレールモデルをactive_adminフォームに追加するにはどうすればよいですか?
ActiveAdmin.register ProspectReview do
permit_params :domain, :media_type, :is_prospect, :category, :corrected_domain, :source, :share, :collection, :api_lookup_at
form do |f|
f.inputs "ProspectReview" do
f.input :domain
f.input :media_type, :as => :select, :collection => ["website","facebook","twitter","blogspot","tumblr","instagram","klout","pinterest","google+","linkedin","youtube","blog","mobile app","lookbook","bloglovin"]
f.input :is_prospect, :as => :select, :collection => ["yes", "no"]
f.input :category, :as => :select, :collection => []
f.input :corrected_domain
f.input :source
f.input :share
end
f.actions
end
end
私は名前の属性を持つmain_topicsと呼ばれるテーブルがあります。
create_table "main_topics", force: :cascade do |t|
t.string "name", limit: 255
t.datetime "created_at", null: false
t.datetime "updated_at", null: false
end
を私の目標は、main_topicsから属性名を追加することですProspectReview ActivAdminフォームカテゴリ選択ドロップダウン:
いつでもテーブルmain_topicsは新しい行で更新されます。名前列にあるものはどれでも、ドロップダウン選択内に入力されます。