title: How to make cakePHP retrieve the data represented by a foreign key?
body: <p>I have a simple database with multiple tables. I can't figure out how to make cakePHP display the values associated with a foreign key in an index view. Or create a view where the fields of my choice (the ones that make sense to users like location name - not location_id can be updated or viewed on a single page).</p>
  
  <p>I have created an example at <a href="http://lovecats.cakeapp.com" rel="nofollow noreferrer">http://lovecats.cakeapp.com</a> that illustrate the question. If you look at the page and click the "list cats", you will notice that it shows the location_id field from the locations table. You will also notice that when you click "add cats", you must choose a location_id from the locations table. This is the automagic way that cakePHP builds the app. I want this to be the field location_name.</p>
  
  <p><img src="https://imgur.com/7pizH.png" alt="alt text"></p>
  
  <p>The database is setup so that the table cats has a foreign key called location_id that has a relationship to a table called locations.</p>
  
  <p><img src="https://imgur.com/RTMqC.png" alt=""></p>
  
  <p>This is my problem: I want these pages to display the location_name instead of the location_id. If you want to login to the application, you can go to <a href="http://cakeapp.com/sqldesigners/sql/lovecats" rel="nofollow noreferrer">http://cakeapp.com/sqldesigners/sql/lovecats</a> and the password 'password' to look at the db relationships, etc.</p>
  
  <p>How do I have a page that shows the fields that I want?  And is it possible to create a page that updates fields from all of the tables at once?</p>
  
  <p>This is the slice of cake that I have been trying to figure out and this would REALLY get me over a hump. You can download the app and sql from the above url.  </p>