How should I use nested attributes with simple_form, Rails 4, and has_many?
<p>I'm trying to use <code>simple_form</code> to create an object and one of its <code>has_many</code> associations with Rails 4.</p>

<p>Here's what I have so far:</p>

<pre><code>class User &lt; ActiveRecord::Base
  has_many :applications
  accepts_nested_attributes_for :applications
end

class Application &lt; ActiveRecord::Base
  belongs_to :user

  def self.allowed_params
      [:over_18]
  end
end

class UsersController &lt; ApplicationController
  def new
    @user = User.new
  end

  def create
    @user = User.new user_params
    @user.save
    # there is more in here, but I don't think it's relevant
  end

  private
  def user_params
    params.require(:user).permit(:name, :email, application: Application.allowed_params)
  end
end
</code></pre>

<p>And finally the form itself</p>

<pre><code>&lt;%= simple_form_for @user do |f| %&gt;
  &lt;%= f.input :name %&gt;
  &lt;%= f.simple_fields_for :application do |a| %&gt;
    &lt;%= a.input :over_18, label: 'Are you over 18?', as: :radio_buttons %&gt;
  &lt;% end %&gt;
  &lt;%= f.button :submit %&gt;
&lt;% end %&gt;
</code></pre>

<p>Whenever I try to create a new user with this setup I get an error: <code>ActiveRecord::UnknownAttributeError: unknown attribute 'application' for User.</code></p>

<p><strong>Question:</strong> What should I change so I can create new users with a nested application?</p>

<p>I've tried changing <code>f.simple_fields_for :application</code> to <code>f.simple_fields_for :applications</code> but then simple_fields didn't render the form elements.</p>