Return thumbnail or screenshot image upon 404 instead of exception
This commit is contained in:
parent
a01d2c751c
commit
6a92292e9b
1 changed files with 2 additions and 2 deletions
|
|
@ -106,7 +106,7 @@ class PackagesController < ApplicationController
|
||||||
# If the package is found but has no screenshots then it also returns a
|
# If the package is found but has no screenshots then it also returns a
|
||||||
# dummy image along with status 404.
|
# dummy image along with status 404.
|
||||||
def thumbnail
|
def thumbnail
|
||||||
@package = Package.find_by!(name: params[:name])
|
@package = Package.find_by(name: params[:name])
|
||||||
unless @package
|
unless @package
|
||||||
thumbnail404
|
thumbnail404
|
||||||
return
|
return
|
||||||
|
|
@ -135,7 +135,7 @@ class PackagesController < ApplicationController
|
||||||
# If the package is found but has no screenshots then it also returns a
|
# If the package is found but has no screenshots then it also returns a
|
||||||
# dummy image along with status 404.
|
# dummy image along with status 404.
|
||||||
def screenshot
|
def screenshot
|
||||||
@package = Package.find_by!(name: params[:name])
|
@package = Package.find_by(name: params[:name])
|
||||||
unless @package
|
unless @package
|
||||||
screenshot404
|
screenshot404
|
||||||
return
|
return
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue