title: Ruby on Rails - How to show foreign key values in one model to another
body: <p>I'am new to Ruby on Rail 4. </p>
  
  <p>I have two models <code>Newspaper</code> and <code>Language</code></p>
  
  <pre><code>class Language &lt; ActiveRecord::Base
     has_many :newspapers
  end
  
  class Newspaper &lt; ActiveRecord::Base
     belongs_to :language
  end
  </code></pre>
  
  <p>This is the tables of two models</p>
  
  <pre><code>language
  --------
  
  * id
  * name
  
  newspaper
  ---------
  
  * id
  * name
  * language_id
  </code></pre>
  
  <p>After generate <code>controllers</code> and <code>db migration</code>, Newspaper <code>index</code> page populate all records with <code>language_id(means reference id)</code> as a table format. But I need to display <code>newspaper</code> corresponding <code>language</code> name in the table.</p>
  
  <p>How to achieve this one? Also is there any problem in making a relationship with these models.</p>