title: Has_many :through Rails 4 Instance variable not working
body: <p>I have problem with strong params in <code>Ruby on Rails 4</code>. 
  I have 3 models <code>Entity</code>, <code>user</code>, <code>user_entity</code>.</p>
  
  <p><code>User_entity</code> ties together <code>entity</code> and <code>user</code> with <code>has_many :through</code> association. </p>
  
  <p>Here is code that works perfectly!</p>
  
  <p>/views/user_entity/show.html.erb</p>
  
  <pre><code>&lt;p&gt;
    &lt;strong&gt;User:&lt;/strong&gt;
    &lt;%= @user_entity.user_id %&gt;
  &lt;/p&gt;
  </code></pre>
  
  <p>And here when I modify it it doesn't!</p>
  
  <pre><code>&lt;p&gt;
    &lt;strong&gt;User:&lt;/strong&gt;
    &lt;%= @user_entity.user.name %&gt;
  &lt;/p&gt;
  </code></pre>
  
  <p>Error I get is this:</p>
  
  <blockquote>
    <p>undefined method `user' for # Extracted
    source (around line #433):<br>
          else
            match = match_attribute_method?(method.to_s)
            match ? attribute_missing(match, *args, &amp;block) : super
          end
        end</p>
  </blockquote>
  
  <p>I think it is because of <code>strong params</code> not allowing me to access data from <code>user</code> controller, but i have no idea how to whitelist that data to <code>user_entity</code> model.</p>
  
  <p>Please help.</p>
  
  <p>/models/entity.rb</p>
  
  <pre><code>class Entity &lt; ActiveRecord::Base
    accepts_nested_attributes_for :user_entities
    has_many :user_entities
    has_many :users, :through =&gt; :user_entities
  end
  </code></pre>
  
  <p>/models/user.rb</p>
  
  <pre><code>class User &lt; ActiveRecord::Base
    accepts_nested_attributes_for :user_entities
    has_many :user_entities
    has_many :entities, :through =&gt; :user_entities
  end
  </code></pre>
  
  <p>/models/user_entity.rb</p>
  
  <pre><code>class User_entity &lt; ActiveRecord::Base
    belongs_to :entities
    belongs_to :users
  end
  </code></pre>