diff --git a/app/controllers/stocks_controller.rb b/app/controllers/stocks_controller.rb index 82d2a4e..e0eadb7 100644 --- a/app/controllers/stocks_controller.rb +++ b/app/controllers/stocks_controller.rb @@ -74,6 +74,8 @@ def show else @stock = Stock.find_by(symbol: params[:ticker], country_code: "US") end + + redirect_to stocks_path unless @stock end def exchanges