# Limiting records selected from table in db

**URL:** <https://www.ruby-forum.com/t/limiting-records-selected-from-table-in-db/90860>\
**Category:** Rails\
**Created:** [April 2, 2007, 3:07pm UTC](https://www.ruby-forum.com/t/limiting-records-selected-from-table-in-db/90860 "2007-04-02T15:07:23Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Lewis](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/l/e9bcb4/32.png) [@Lewis](https://www.ruby-forum.com/u/Lewis)\
**Post date:** [April 2, 2007, 3:07pm UTC](https://www.ruby-forum.com/t/limiting-records-selected-from-table-in-db/90860/1 "2007-04-02T15:07:23Z")

</div>

Hi all,

I have a table within my application database that stores addresses  
(i.e. Businesses, residents, libraries, hospitals etc). I want to  
select from that table only residents (defined as addr\_type = “R” in  
addr\_type\_table) and display a list of these addresses and then be  
able to do a find of ex. Jane Doe. I have the find worked out,  
however I have not been able to successfully limit my initial list of  
addresses to only those of type= “R”. If I do it in the controlller,  
then on initial start up on get all types of addresses. I have tried  
to work through the model to limit the records but have had no luck.  
Can anyone help?

Thanks,  
Lewis
