# How to display the content of one tble on another table view

**URL:** <https://www.ruby-forum.com/t/how-to-display-the-content-of-one-tble-on-another-table-view/80080>\
**Category:** Rails\
**Created:** [December 21, 2006, 8:37am UTC](https://www.ruby-forum.com/t/how-to-display-the-content-of-one-tble-on-another-table-view/80080 "2006-12-21T08:37:16Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![prashant](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/p/51bf81/32.png) [@prashant](https://www.ruby-forum.com/u/prashant)\
**Post date:** [December 21, 2006, 8:37am UTC](https://www.ruby-forum.com/t/how-to-display-the-content-of-one-tble-on-another-table-view/80080/1 "2006-12-21T08:37:16Z")

</div>

hi all,  
i just started on rails and ma trying to learn it so pls help me out  
with following problem

i got 2 tables say tbl1 and tbl2 (tbl1 primary key is tbl2 foregn key)  
both the tables have cntrls(say cntrl1 and cntr2) and models(model1 and  
model2)  
now i want to display the contens of tble2 in the show only tht contnds  
of tbl2 whose foregn key is primary key of tbl1. that 2 in the rhtml  
view of tbl1

also how do i add the primary key of tbl1 as foreing key of tbl2

pls help me out
