title: displaying a model in a different model's view
body: <p>I have two models so far in a rails application.</p>
  
  <ul>
  <li>My <code>User</code> model has fields like <code>id</code>, <code>first_name</code>, <code>last_name</code>, <code>password</code></li>
  <li>My <code>Wallet</code> model has fields like <code>name</code>, <code>money</code>, <code>user_id</code></li>
  </ul>
  
  <p>Within the applications view, I can display my <code>User</code> by inserting</p>
  
  <pre><code>&lt;h1&gt;&lt;%= @user.first_name %&gt;&lt;/h1&gt;
  </code></pre>
  
  <p>But am not able to display </p>
  
  <pre><code>&lt;h1&gt;&lt;%= @wallet.money %&gt;&lt;/h1&gt;
  </code></pre>
  
  <p>I get a <code>no method error</code> in <code>users#show</code>.  I don't understand this error.  </p>
  
  <p>I have a method called <code>show</code> that contains <code>@user = User.find(params[:id])</code> with <code>params</code> defined in a private method below.</p>
  
  <p>My question is, do I need a controller and a view for my <code>Wallet</code> model?  I didn't think I did because I am trying to display content through the applications controller. Even though the page being directed to is <code>Users#show</code>.  </p>
  
  <p>Ideally, since the wallet has a <code>user_id</code>, I'd love to display the money value through that... something like
  <code>@user.wallet.money</code> or something... to call the money value through the foreign key associated with the current user.</p>