Browse Source

turbo progress bar

pagy
pvincent 10 months ago
parent
commit
0702a1c340
  1. 5
      app/assets/stylesheets/application.turbo.css
  2. 4
      app/controllers/scores_controller.rb
  3. 1
      app/models/application_record.rb
  4. 3
      app/models/score.rb

5
app/assets/stylesheets/application.turbo.css

@ -0,0 +1,5 @@
.turbo-progress-bar {
height: 10px;
background: rgb(0,0,0);
background: linear-gradient(90deg, rgba(0,0,0,1) 0%, rgba(0,192,250,1) 35%, rgba(0,32,249,1) 100%);
}

4
app/controllers/scores_controller.rb

@ -18,7 +18,9 @@ class ScoresController < ApplicationController
end
# GET /scores/1
def show; end
def show
sleep 1.5
end
# GET /scores/new
def new

1
app/models/application_record.rb

@ -1,3 +1,4 @@
# abstract default ActiveRecord class
class ApplicationRecord < ActiveRecord::Base
primary_abstract_class
end

3
app/models/score.rb

@ -1,2 +1,5 @@
# Score defines a grade per software game
class Score < ApplicationRecord
validates :name, presence: true
validates :grade, presence: true
end
Loading…
Cancel
Save