Changed naming from Routes to Controllers; fixed some Sinatra modular layout stuff; added RSpec for testing and some basic tests
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful
This commit is contained in:
18
src/controllers/index.rb
Normal file
18
src/controllers/index.rb
Normal file
@@ -0,0 +1,18 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
require_relative 'base_controller'
|
||||
require_relative '../models/test'
|
||||
|
||||
# / (top-level) routes
|
||||
class IndexController < BaseController
|
||||
|
||||
get '/' do
|
||||
tests = Test.reverse(:updated_at).limit(10).all()
|
||||
|
||||
erb :'index/index', locals: {
|
||||
title: 'Dashboard',
|
||||
tests: tests
|
||||
}
|
||||
end
|
||||
|
||||
end
|
Reference in New Issue
Block a user