我遇到ActiveAdmin問題。ActiveAdmin表單問題(has_many)
我有以下型號:
template.rb
class Template < ActiveRecord::Base
belongs_to :category
has_many :template_questions
has_many :questionnaires
attr_accessible :category, :string
accepts_nested_attributes_for :template_questions
end
template_question.rb
class TemplateQuestion < ActiveRecord::Base
belongs_to :template
attr_accessible :number, :question
end
而且這種主動管理資源
ActiveAdmin.register Template do
form do |f|
f.inputs "Details" do
f.input :title
f.input :category
end
f.inputs "Questions" do
f.has_many :template_questions do |j|
j.input :question
end
end
f.buttons
end
end
當我上ActiveAdmin界面中的表單正確地顯示了標題和類別的字段,然後在問題部分我得到一個按鈕來添加一個問題,但點擊它時什麼也不做。
任何想法我做錯了什麼?謝謝!
這不是我的主要問題,原來是與JavaScript的東西。但是非常感謝,這對我後來的確幫助很大! – 2012-07-13 22:47:29
我遇到同樣的問題。你能告訴我們什麼是「JavaScript的東西」是什麼? – jeem 2013-02-05 12:25:28