【发布时间】:2014-11-06 12:58:31
【问题描述】:
我有一个简单的多态关联:
class Highlight < ActiveRecord::Base
belongs_to :highlightable, polymorphic: true
end
class Property < ActiveRecord::Base
has_many :highlights, as: :highlightable
end
class Destination < ActiveRecord::Base
has_many :highlights, as: :highlightable
end
在 active_admin 表单中创建新的 Highlight 我如何将其分配给 Property 或 Destination?
【问题讨论】:
-
你有想过这个吗?
标签: ruby-on-rails activeadmin formtastic