class HomeController < ApplicationController
  def index
  end

  def search
    @query = params[:query].presence || '*'

    @recipes = Recipe.search @query
  end
end

class HomeController < ApplicationController
  def index
  end

  def search
    @query = params[:query].presence || '*'

    @recipes = Recipe.search_by_ingredients @query
  end
end

Use method search_by_ingredients in search
Use method search_by_ingredients in search
