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:
@@ -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
|
||||
Reference in New Issue
Block a user