Polymorphic Associations and Formtastic in ActiveAdmin
I have a simple polymorphic association:
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
In the active_admin form to create a new Highlight item, how can I assign it to either Property or Destination?
+3
source to share