【发布时间】:2012-08-04 08:14:54
【问题描述】:
以下是我的模型:
class Poll < ActiveRecord::Base
attr_accessible :published, :title
validates :published, :presence => true
validates :title, :presence => true,
:length => { :minimum => 10 }
has_many :choice, :dependent => :destroy
end
class Choice < ActiveRecord::Base
belongs_to :poll
attr_accessible :choice_text, :votes
validates :choice_text, :presence => true
end
然后我尝试安装rails admin。我能够在管理员中创建选择和民意调查,但我无法将选择与民意调查相关联,反之亦然。
我该怎么做?
【问题讨论】:
标签: ruby-on-rails ruby-on-rails-3 rails-admin