Skip to content

Commit

Permalink
Prevent to store wrong session[:last_page] in terms#show
Browse files Browse the repository at this point in the history
  • Loading branch information
wildjcrt committed Sep 11, 2024
1 parent 769678c commit ecaf428
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion app/controllers/terms_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ def index

def show
@terms = Term.includes(:dictionary, :stem, descriptions: %i[examples synonyms]).where(name: params[:id]).order(:dictionary_id)
redirect_back(fallback_location: "/") if @terms.empty?
return redirect_back(fallback_location: "/") if @terms.empty?

session[:last_page] = request.url
end
Expand Down

0 comments on commit ecaf428

Please sign in to comment.