Announcement (2017-05-07): www.ruby-forum.com is now read-only since I
unfortunately do not have the time to support and maintain the forum any
more. Please see rubyonrails.org/community and ruby-lang.org/en/community
for other Rails- und Ruby-related community platforms.

Hi folks,
Bit confused by rails and the active record stuff for searching across
tables.
Say I have a property which has an address and I want to search to
provide a form that takes one item and searches across both the address
and property tables... how do I go about it?
Thanks in advance
Marty

On 2/15/06, Marty Henderson <henderson.marty@gmail.com> wrote:
> Hi folks,>> Bit confused by rails and the active record stuff for searching across> tables.>> Say I have a property which has an address and I want to search to> provide a form that takes one item and searches across both the address> and property tables... how do I go about it?>
Does this help?
http://rails.techno-weenie.net/question/2006/1/13/...

On 15-feb-2006, at 16:49, Marty Henderson wrote:
> Hi folks,>> Bit confused by rails and the active record stuff for searching across> tables.>> Say I have a property which has an address and I want to search to> provide a form that takes one item and searches across both the> address> and property tables... how do I go about it?
If you have many models with the same attribute (and you want to
search across these models but in this attribute only)
[Person, Company].inject([]) do | result, class |
result += class.find_all_by_address(address_query)
end

Julian 'Julik' Tarkhanov wrote:
> On 15-feb-2006, at 16:49, Marty Henderson wrote:>>> Hi folks,>>>> Bit confused by rails and the active record stuff for searching across>> tables.>>>> Say I have a property which has an address and I want to search to>> provide a form that takes one item and searches across both the>> address>> and property tables... how do I go about it?>> If you have many models with the same attribute (and you want to> search across these models but in this attribute only)>> [Person, Company].inject([]) do | result, class |> result += class.find_all_by_address(address_query)> end
cheers for the help folks.
did it just using sql for simplicity..