title: Nested forms with has_one :through
body: <p>I'm having some trouble to implement a nested form with a <code>has_one :through</code> association.</p>
  
  <h2>Models</h2>
  
  <pre><code># model: member.rb
  
  belongs_to :user
  has_one :academic
  
  # model: user.rb
  
  has_one :member
  has_one :academic, through: :member
  
  accepts_nested_attributes_for :member, reject_if: :all_blank 
  accepts_nested_attributes_for :academic, reject_if: :all_blank
  
  # model: academic.rb
  
  belongs_to :member
  belongs_to :user 
  </code></pre>
  
  <h2>Controller</h2>
  
  <pre><code># users_controller.rb
  
  def new
    @user = User.new
    @user.build_member
    @user.build_academic  
  end
  </code></pre>
  
  <p>I also have tried with:</p>
  
  <pre><code>@user.member.build_academic
  </code></pre>
  
  <h2>View</h2>
  
  <pre><code># new.html.erb
  
  &lt;%= simple_form_for(resource, as: resource_name, url: registration_path(resource_name)) do |ff| %&gt;
  
    &lt;%= ff.text_field :email %&gt;
  
  # member belongs to user so I can call a fields_for
  &lt;% ff.fields_for :member do |f| %&gt;
  
    &lt;%= f.text_field :name %&gt;
  
  # this part is not shown. What is wrong with my association?
  &lt;% f.fields_for :academic do |a| %&gt;
  
    &lt;%= a.text_field :major %&gt;
  
  &lt;% end %&gt;
   &lt;% end %&gt;
    &lt;% end %&gt;
  </code></pre>
  
  <p>I've taken a look into the Rails documentation. The first <code>fields_for</code> is shown in the page (<code>:member</code>), but the second one (<code>:academic</code>), which has the <code>has_one :through</code> association, is not shown in the page.</p>
  
  <p>Any help will be appreciated. Thank you.</p>