我正在尝试为与 ActiveScaffold 的多态关联创建一个下拉选择框。
我有:
class Award
belongs_to :sponsorship, :polymorphic => :true
end
class Organization
has_many :awards, :as => :sponsorship
end
class Individual
has_many :awards, :as => :sponsorship
end
在尝试在 Awards_controller 中创建一个选择下拉框时:
config.columns[:sponsorship].form_ui = :select
我收到以下错误:
ActionView::TemplateError(未初始化常量 Award::Sponsorship)
我不确定这是我做的不对还是我想要完成的事情在 AS 中没有直接支持。
非常感谢一些建议。