Skip to content

Commit

Permalink
Make use of render_not_found to simplify 404 response
Browse files Browse the repository at this point in the history
Co-authored-by: Martin Emde <[email protected]>
  • Loading branch information
kinsomicrote and martinemde authored Oct 19, 2024
1 parent c4aab95 commit 99891bf
Showing 1 changed file with 2 additions and 9 deletions.
11 changes: 2 additions & 9 deletions app/controllers/profiles_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,8 @@ class ProfilesController < ApplicationController

def show
@user = User.find_by_slug!(params[:id])
return @rubygems = @user.rubygems_downloaded.includes(%i[latest_version gem_download]).strict_loading if @user.email_confirmed?
respond_to do |format|
format.any do
render plain: t(:this_rubygem_could_not_be_found), status: :not_found
end
format.html do
render file: Rails.public_path.join("404.html"), status: :not_found, layout: false, formats: [:html]
end
end
return render_not_found unless @user.email_confirmed?
@rubygems = @user.rubygems_downloaded.includes(%i[latest_version gem_download]).strict_loading
end

def me
Expand Down

0 comments on commit 99891bf

Please sign in to comment.