title: How do I populate a model in Rails?
body: <p>I am fairly new to Rails and I am currently trying to wrap my head around the model/db aspect of the framework. Albeit, I am having some trouble with understanding the connections between models, the database schema, and the views/controller.</p>
  
  <p>For example, lets say that I have an Articles model and the Articles model has_many authors. How do I go about populating the Articles model with actual Articles/content and the Authors model with an array of corresponding Authors? </p>
  
  <p>In other words: If I were to have </p>
  
  <pre><code>articles = Articles.search(params[:search])
  </code></pre>
  
  <p>in my controller how would the Articles object know to search the actual Articles/content that I have written in the view? I am having trouble understanding that connection.</p>
  
  <p>I hope this makes sense.</p>
  
  <p>Any insights would be appreciated!
  Thanks.</p>