過去に似たようなことを質問したことがありますが、質問の言い方が間違っていたのではないかと思います。
レールでオブジェクトの表示アクションを介して現在の属性を取得し、その属性に対して検索機能を実行できるかどうかを知りたいです。例えば
def show
@recipe = Recipe.find(params[:id])
end
レシピモデル内には属性があります
:dish_name
これは、どのレシピを見ているかによって変わるので、ショーページに表示されている現在の料理名に似たレシピをリストしたいとします。どうすればよいでしょうか? 正しい方向へのいくつかの指針を探しているだけです。私はsolrを見てきましたが、検索機能のためにランサックに固執することに決めましたが、ランサックでこれを達成する方法がわかりません..誰かが以前にこのような方法を書いたことがありますか?
BBCの食べ物は、私が達成したいことと同じではないにしても、似たようなことをします
http://www.bbc.co.uk/food/recipes/easy_chocolate_cake_31070
右側を見ると、関連レシピと呼ばれるセクションが表示されます
任意の助けをいただければ幸いです