title: Associations cause "EMPTY" in Active Admin
body: <p>So I'm learning more about belongs_to and has_many Associations in Rails and am combining it with ActiveAdmin.</p>
  
  <p>I have created a Model "Semester" and a Model "Field". A Semester has many Fields and a Field belongs to Semester.</p>
  
  <p>My field Class looks like this:</p>
  
  <pre><code>class Field &lt; ApplicationRecord
    belongs_to :semester
    accepts_nested_attributes_for :semester, allow_destroy: true
  end
  </code></pre>
  
  <p>and my Semester class looks like this:</p>
  
  <pre><code>class Semester &lt; ApplicationRecord
    has_many :fields
    accepts_nested_attributes_for :fields, allow_destroy: true
  end
  </code></pre>
  
  <p>Now I registered the Models with active admin with the following two files:</p>
  
  <pre><code>ActiveAdmin.register Field do
  
    permit_params :name, semesters_attributes: [:name]
  
  end
  </code></pre>
  
  <p>and</p>
  
  <pre><code>ActiveAdmin.register Semester do
  
    permit_params :name, :fields, fields_attributes: [ :field_id, :name]
  
  end
  </code></pre>
  
  <p>And now there are two issues that come up upon proceeding that I absolutely can not ged rid off:</p>
  
  <p>1) If I do not add <code>optional: true</code> after <code>belongs_to :semester</code> I will get an error message "must exist" upon trying to create a new Field with a respective Semester.</p>
  
  <p>2) If I do add <code>optional: true</code> after <code>belongs_to :semester</code> I will be able to create a new Field but the "Semester" will just be "EMPTY" in the new field.</p>
  
  <p>The console output of case 2) will look like this:</p>
  
  <pre><code>Started POST "/admin/fields" for 127.0.0.1 at 2018-08-17 15:23:54 +0200
  Processing by Admin::FieldsController#create as HTML
    Parameters: {"utf8"=&gt;"✓", "authenticity_token"=&gt;"+GPjjNPOv9GsjXnEtEjBcC0xUMHKKC+YpFLfiUFUOgsgBJ+pLCucscrN0YaTk551GFp4K5lBEI2RW1clw2vCWw==", "field"=&gt;{"semester_id"=&gt;"2", "name"=&gt;"MAVT"}, "commit"=&gt;"Create Field"}
    AdminUser Load (0.1ms)  SELECT  "admin_users".* FROM "admin_users" WHERE "admin_users"."id" = ? ORDER BY "admin_users"."id" ASC LIMIT ?  [["id", 1], ["LIMIT", 1]]
    ↳ /home/divepit/.rbenv/versions/2.5.1/lib/ruby/gems/2.5.0/gems/activerecord-5.2.1/lib/active_record/log_subscriber.rb:98
  Unpermitted parameter: :semester_id
     (0.0ms)  begin transaction
    ↳ /home/divepit/.rbenv/versions/2.5.1/lib/ruby/gems/2.5.0/gems/activerecord-5.2.1/lib/active_record/log_subscriber.rb:98
    Field Create (0.6ms)  INSERT INTO "fields" ("name", "created_at", "updated_at") VALUES (?, ?, ?)  [["name", "MAVT"], ["created_at", "2018-08-17 13:23:54.026418"], ["updated_at", "2018-08-17 13:23:54.026418"]]
    ↳ /home/divepit/.rbenv/versions/2.5.1/lib/ruby/gems/2.5.0/gems/activerecord-5.2.1/lib/active_record/log_subscriber.rb:98
     (12.2ms)  commit transaction
    ↳ /home/divepit/.rbenv/versions/2.5.1/lib/ruby/gems/2.5.0/gems/activerecord-5.2.1/lib/active_record/log_subscriber.rb:98
  Redirected to http://0.0.0.0:3000/admin/fields/22
  Completed 302 Found in 22ms (ActiveRecord: 13.0ms)
  
  
  Started GET "/admin/fields/22" for 127.0.0.1 at 2018-08-17 15:23:54 +0200
  Processing by Admin::FieldsController#show as HTML
    Parameters: {"id"=&gt;"22"}
    AdminUser Load (0.2ms)  SELECT  "admin_users".* FROM "admin_users" WHERE "admin_users"."id" = ? ORDER BY "admin_users"."id" ASC LIMIT ?  [["id", 1], ["LIMIT", 1]]
    ↳ /home/divepit/.rbenv/versions/2.5.1/lib/ruby/gems/2.5.0/gems/activerecord-5.2.1/lib/active_record/log_subscriber.rb:98
    Field Load (0.1ms)  SELECT  "fields".* FROM "fields" WHERE "fields"."id" = ? LIMIT ?  [["id", 22], ["LIMIT", 1]]
    ↳ /home/divepit/.rbenv/versions/2.5.1/lib/ruby/gems/2.5.0/gems/activerecord-5.2.1/lib/active_record/log_subscriber.rb:98
    Rendering /home/divepit/.rbenv/versions/2.5.1/lib/ruby/gems/2.5.0/gems/activeadmin-1.3.1/app/views/active_admin/resource/show.html.arb
     (0.1ms)  SELECT COUNT(*) FROM "active_admin_comments" WHERE "active_admin_comments"."resource_type" = ? AND "active_admin_comments"."resource_id" = ? AND "active_admin_comments"."namespace" = ?  [["resource_type", "Field"], ["resource_id", 22], ["namespace", "admin"]]
    ↳ /home/divepit/.rbenv/versions/2.5.1/lib/ruby/gems/2.5.0/gems/activerecord-5.2.1/lib/active_record/log_subscriber.rb:98
    ActiveAdmin::Comment Exists (0.1ms)  SELECT  1 AS one FROM "active_admin_comments" WHERE "active_admin_comments"."resource_type" = ? AND "active_admin_comments"."resource_id" = ? AND "active_admin_comments"."namespace" = ? LIMIT ? OFFSET ?  [["resource_type", "Field"], ["resource_id", 22], ["namespace", "admin"], ["LIMIT", 1], ["OFFSET", 0]]
    ↳ /home/divepit/.rbenv/versions/2.5.1/lib/ruby/gems/2.5.0/gems/activerecord-5.2.1/lib/active_record/log_subscriber.rb:98
    Rendered /home/divepit/.rbenv/versions/2.5.1/lib/ruby/gems/2.5.0/gems/activeadmin-1.3.1/app/views/active_admin/resource/show.html.arb (73.4ms)
  Completed 200 OK in 77ms (Views: 74.9ms | ActiveRecord: 0.5ms)
  </code></pre>
  
  <p>Thanks in advance for any tips on how to solve this! :)</p>