diff --git a/app/controllers/guide_cards_controller.rb b/app/controllers/guide_cards_controller.rb index e62e30f..f8a23d1 100644 --- a/app/controllers/guide_cards_controller.rb +++ b/app/controllers/guide_cards_controller.rb @@ -8,6 +8,7 @@ def index def search @exact_match = GuideCard.find_by(heading: params[:search_term]) + @exact_match = GuideCard.where('heading < ?', 'Aarons').limit(1).order(heading: :desc).first if @exact_match.nil? @guide_cards = GuideCard.page(@exact_match.index_page) end diff --git a/app/views/guide_cards/search.html.erb b/app/views/guide_cards/search.html.erb index 4f21c01..7a950f0 100644 --- a/app/views/guide_cards/search.html.erb +++ b/app/views/guide_cards/search.html.erb @@ -2,7 +2,7 @@ <% @guide_cards.each do |card| %>