# Search with multiple tables

**URL:** <https://www.ruby-forum.com/t/search-with-multiple-tables/124565>\
**Category:** Rails\
**Created:** [December 30, 2007, 9:56am UTC](https://www.ruby-forum.com/t/search-with-multiple-tables/124565 "2007-12-30T09:56:44Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![katsuo](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/k/ecc23a/32.png) [@katsuo](https://www.ruby-forum.com/u/katsuo)\
**Post date:** [December 30, 2007, 9:56am UTC](https://www.ruby-forum.com/t/search-with-multiple-tables/124565/1 "2007-12-30T09:56:44Z")

</div>

Hi, can anyone help me with the following action so that I can search  
from not only one but two tables and fields. I would like to search from  
name field in author table as well as name field in title table.

def search  
@title\_pages, @titles = paginate :titles, :per\_page =\> 10,  
:conditions =\> [“name LIKE ?”, params[:title][:name] + ‘%’ ]  
@keyword = params[:title][:name]  
render :action =\> ‘list’  
end

Please help
