title: Selecting which value to have a unique id on model
body: <p>I have two models Deals and Restaurants</p>
  
  <p>I want to display the deals for each restaurant.  I do not want them linked on <code>:restaurant_id</code>, rather i want them linked on <code>:restaurant_name</code>.</p>
  
  <p>What I cant figure out is how to link them on <code>:restaurant_name</code> in the controller</p>
  
  <pre><code>restaurant controller
  
  def show
      @restaurant = Restaurant.find(params[:id])
      @deals = @restaurant.deals
  end
  
  
  
  show.html.erb
  
  &lt;% restaurant.deals.each do |deal| %&gt;
         &lt;h2&gt;&lt;center&gt;&lt;%= deal.day %&gt;&lt;/center&gt;&lt;/h2&gt;
  &lt;% end %&gt;
  </code></pre>
  
  <p>Any Ideas?</p>