Polymorphism, acts_as_relation gem and nested attributes

I have the following polymorphic association set up with
acts_as_relation (https://github.com/hzamani/acts_as_relation)

Model code:

    class Email < ActiveRecord::Base
      belongs_to :detail
      validates_presence_of :address

    class Detail < ActiveRecord::Base
      has_many :emails
      accepts_nested_attributes_for :emails, allow_destroy: true

    class User < ActiveRecord::Base
      acts_as :detail
      validates_presence_of :username, :password

Migration code:

    class CreateInfo < ActiveRecord::Migration
      def change
        create_table :details, :as_relation_superclass => true do |t|

    class CreateEmails < ActiveRecord::Migration
      def change
        create_table :emails do |t|
          t.string :address
          t.string :address_type
          t.string :detail_id


    class CreateUsers < ActiveRecord::Migration
      def change
        create_table :users do |t|
          t.string :name
          t.string :username
          t.string :password


I'm want to be able to have a form (eventually) that will allow multiple
email addresses, addresses and so on. But I'm struggling to get it to
work. I use HAML for whoever may reply with the view code, which is a
lot more readable.

I have the form currently something like this:


    = form_for(@user) do |f|
      - if @user.errors.any?
            = pluralize(@user.errors.count, "error")
            prohibited this user from being saved:
            - @user.errors.full_messages.each do |msg|
              %li= msg
        = f.label :name
        = f.text_field :name
        = f.label :username
        = f.text_field :username
        = f.label :password
        = f.text_field :password
      = f.fields_for :emails do |ff|
          = ff.label :address, 'Email address'
          = ff.text_field :address
          = ff.label :address_type, 'Type'
          = ff.text_field :address_type
        = f.submit