私のアプリケーションは飲み物モデルで構成されています
class Drink < ActiveRecord::Base
attr_accessible :name
has_many :recipe_steps, :dependent => :destroy
has_many :ingredients, through: :recipe_steps
end
成分モデル
class Ingredient < ActiveRecord::Base
attr_accessible :name
has_many :recipe_steps
end
ユーザーが食材を検索すると、その食材を含むすべての飲み物が返されるようにするにはどうすればよいですか?
追加情報: 現在、検索に sunspot/solr を使用しています。