ユーザーモデル
belongs_to :role, :polymorphic => true
admin_profileモデル(実際の名前ではありませんが、アイデアは得られます)
has_one :user, :as => :role
user_profileモデル(実際の名前ではありませんが、アイデアは得られます。これら2つ以外にも他にもあります。)
has_one :user, :as => :role
/ admin_profile / newにアクセスすると、1行目に「nilはシンボルではありません」TypeErrorが表示されます。
<%= form_for(@admin_profile) do |f| %>
...
@admin_profileの内容は次のとおりです。
<AdminProfile id: nil, birth_date: nil, url: nil>
トレースは次のようになります
activerecord (3.1.1) lib/active_record/attribute_methods/primary_key.rb:8:in `to_key'
actionpack (3.1.1) lib/action_controller/record_identifier.rb:76:in `record_key_for_dom_id'
actionpack (3.1.1) lib/action_controller/record_identifier.rb:57:in `dom_id'
actionpack (3.1.1) lib/action_view/helpers/form_helper.rb:388:in `apply_form_for_options!'
actionpack (3.1.1) lib/action_view/helpers/form_helper.rb:365:in `form_for'
他に必要な情報があれば、私に知らせてください。