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
+25
View File
@@ -0,0 +1,25 @@
class GameData < Sinatra::Base
get '/benchmark' do
benchmarks = Benchmark.reverse(:updated_at).limit(10).all()
erb :'benchmark/index', locals: {
title: 'List of Benchmarks',
benchmarks: benchmarks
}
end
get '/benchmark/add' do
erb :'benchmark/add', locals: {
title: 'Add Benchmark'
}
end
post '/benchmark/add' do
benchmark = Benchmark.create(
name: params[:benchmark_name],
scoring: params[:benchmark_scoring],
description: params[:benchmark_description]
)
redirect "/benchmark"
end
end