I have a model, listings. Listings habtm categories and subcategories,
which are seperate models.
What I want to do is search categories for certain items, like so:
@categories = Category.find(:all, :conditions => [“name LIKE ?”,
and subcategories for the same:
@subcategories = Subcategory.find(:all, :conditions => [“name LIKE ?”,
Then I want to get @categories.listings, @subcategories.listings, merge
them into @listings, sort them by once of their fields, and display
them like so:
<% for listing in @listings %>
<%= render :partial action => “listing” %>
<% end %>
Any ideas? I know how to sort one of the find results, but merging them
doesn’t seem so simple.