Skip to content

Commit

Permalink
Redirect to root if not found
Browse files Browse the repository at this point in the history
  • Loading branch information
Shpigford committed Nov 13, 2024
1 parent f8ac804 commit 277f952
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions app/controllers/stocks_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 277f952

Please sign in to comment.