From 1f01718b65d52f32e6efa1e7bc2568e1243ead57 Mon Sep 17 00:00:00 2001 From: wildjcrt Date: Wed, 11 Sep 2024 03:41:55 +0800 Subject: [PATCH] Fix double render error in dictionary_terms#show --- app/controllers/dictionary_terms_controller.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/controllers/dictionary_terms_controller.rb b/app/controllers/dictionary_terms_controller.rb index 74a2fdd..097d79e 100644 --- a/app/controllers/dictionary_terms_controller.rb +++ b/app/controllers/dictionary_terms_controller.rb @@ -1,10 +1,10 @@ class DictionaryTermsController < ApplicationController def show @dictionary = Dictionary.find_by(id: params[:dictionary_id]) - redirect_back(fallback_location: "/") if @dictionary.blank? + return redirect_back(fallback_location: "/") if @dictionary.blank? @terms = @dictionary.terms.includes(:dictionary, :stem, descriptions: %i[examples synonyms]).where(name: params[:id]) - redirect_back(fallback_location: "/") if @terms.empty? + return redirect_back(fallback_location: "/") if @terms.empty? session[:last_page] = request.url