title: Rails - how do you display data from the database
body: <p>Im fairly new to Rails and i am simply trying to display the user_id of a record in a sqlite3 database on a page. Here is my code:</p>
  
  <h2>Model</h2>
  
  <pre><code>class User &lt; ActiveRecord::Base
    set_primary_key :user_id
    has_one :user_id
  end
  </code></pre>
  
  <h2>Controller</h2>
  
  <pre><code>class HomeController &lt; ApplicationController
    def index
      @users = User.find(0)
    end
  end
  </code></pre>
  
  <h2>View</h2>
  
  <pre><code>&lt;%= User.users.user_id %&gt;
  </code></pre>
  
  <p>Im sure im making a silly mistake.</p>