title: Simple_form: simple_fields_for not showing the form
body: <p>I'm trying to create two model in just one form. I have <code>user</code> and <code>unit</code> model both are associated with has_many :through association.</p>
  
  <p>user.rb</p>
  
  <pre><code>class User &lt; ActiveRecord::Base
    has_many :units, :through =&gt; :user_unit_assocs
    has_many :user_unit_assocs
  end
  </code></pre>
  
  <p>unit.rb</p>
  
  <pre><code>class Unit &lt; ActiveRecord::Base
    has_many :users, :through =&gt; :user_unit_assocs
    has_many :user_unit_assocs
  end
  </code></pre>
  
  <p>users_controller.rb</p>
  
  <pre><code>class UsersController &lt; ApplicationController
    def create
      @user = User.new(user_params)
      @user.units.build
      respond_to do |format|
        if @user.save
          format.html { redirect_to @user, notice: 'User was successfully created.' }
        else
          format.html { render :new }
        end
      end
    end
  
    private
    def user_params
        params.require(:user).permit(:username, :email, units_attributes:[:unitname])
      end
  end
  </code></pre>
  
  <p>This is my form, users <code>new</code></p>
  
  <pre><code>&lt;%= simple_form_for(@user) do |f| %&gt;
    &lt;%= f.simple_fields_for :units do |unit| %&gt;
      &lt;%= unit.input :unitname, required: true %&gt;
    &lt;% end %&gt;
    &lt;%= f.input :name, required: true %&gt;
    &lt;%= f.input :email, required: true %&gt;
  
    &lt;%= f.button :submit %&gt;
  &lt;% end %&gt;
  </code></pre>
  
  <p>When I run the code, the form only showing a input-field for <code>:name</code> and <code>:email</code> and there is no input-field for <code>units:[:unitname]</code>. How can I show the input-field in the form? Thanks in advance.</p>
  
  <p>References:
   1. <a href="https://stackoverflow.com/questions/18540679/rails-4-accepts-nested-attributes-for-and-mass-assignment">Rails 4: accepts_nested_attributes_for and mass assignment</a>
   2. <a href="https://github.com/plataformatec/simple_form/wiki/Nested-Models" rel="nofollow noreferrer">https://github.com/plataformatec/simple_form/wiki/Nested-Models</a></p>