rails-api nested attributes for a polymorphic association <p>I have a polymorphic association like so:</p> <pre><code>class Client &lt; ActiveRecord::Base belongs_to :contractable, :polymorphic =&gt; true end class Individual &lt; ActiveRecord::Base has_many :clients, :as =&gt; :contractable end class Business &lt; ActiveRecord::Base has_many :clients, :as =&gt; :contractable end </code></pre> <p>If I want to send a POST to my controller for clients (<code>POST /clients</code>), when I send the JSON in the request body, how do I specify to create either an individual OR a business and set the association properly?</p> <p>Ex JSON (not working):</p> <pre><code>{ "client": { "name": "Person", "contractable": { "age": 50 } } } </code></pre> <p>Also, how do I tell strong_params to allow this to happen?</p>