title: Ruby on rails associations not working
body: <p>I have two files.</p>
  
  <p><strong>clans.rb</strong></p>
  
  <pre><code>class Clans &lt; ActiveRecord::Base
    belongs_to :User
  end
  </code></pre>
  
  <p><strong>user.rb</strong></p>
  
  <pre><code>class User &lt; ActiveRecord::Base
    has_one :Clan
  end
  </code></pre>
  
  <p>I also have two mysql tables.</p>
  
  <p><strong>clans:</strong> id | name | prefix | description | user_id</p>
  
  <p><strong>users:</strong> id | username | password | email | bindcode</p>
  
  <p>clans.user_id being users.id of the clan leader.</p>
  
  <p>In my code I can use the following in show.html.erb and it gives me the clan name.</p>
  
  <pre><code>&lt;%= Clans.find(params[:id]).name %&gt;
  </code></pre>
  
  <p>But I want to be able to do: Clans.find(params[:id]).leader.(users fields)
  Example:</p>
  
  <pre><code>&lt;%= Clans.find(params[:id]).leader.username %&gt;
  </code></pre>
  
  <p>How can I achieve this?</p>