Added functionality to add new hardware and benchmarks to tie to results (this may be moved to an admin panel later)

This commit is contained in:
2023-07-05 22:08:37 -04:00
parent 6c1c8bca0a
commit 291db231d5
8 changed files with 207 additions and 3 deletions
+24
View File
@@ -0,0 +1,24 @@
class GameData < Sinatra::Base
get '/hardware' do
hardware = Hardware.reverse(:updated_at).limit(10).all()
erb :'hardware/index', locals: {
title: 'List of Hardware',
hardware: hardware
}
end
get '/hardware/add' do
erb :'hardware/add', locals: {
title: 'Add Hardware'
}
end
post '/hardware/add' do
hardware = Hardware.create(
name: params[:hardware_name],
type: params[:hardware_type]
)
redirect "/hardware"
end
end