User-friendly 404-page added

This commit is contained in:
Christoph Haas 2016-07-15 18:16:11 +02:00
parent c877e8a0b4
commit 97c5878227
2 changed files with 28 additions and 1 deletions

View file

@ -11,7 +11,12 @@ class PackagesController < ApplicationController
end
def details
@package = Package.find_by!(name: params[:name])
@package = Package.find_by(name: params[:name])
unless @package
@packagename = params[:name]
render 'notfound'
end
end
def upload

View file

@ -0,0 +1,22 @@
.row
h1
i.fi-alert
' No such package…
p
' I'm afraid but there is no package
em =@package_name
' in the database. It may be that a package that is available
' in your favorite Linux distribution is not listed here.
' If you think this is an error then feel free to leave
a href="mailto:email@christoph-haas.de" feedback
p
' Perhaps you want to search for some other piece of software?
= form_tag(packages_grid_path, method: 'GET')
div.row.collapse.postfix-round
div.small-9.columns
input type="text" name="search"autofocus="true"
div.small-3.columns
input.button.postfix type="submit" value="Search"