about summary refs log tree commit diff
path: root/app
diff options
context:
space:
mode:
authorBen Harris <ben@tilde.team>2021-08-27 00:40:47 -0400
committerBen Harris <ben@tilde.team>2021-08-27 00:40:47 -0400
commit68f5f71701f53dffba53b3390b8e01cc23cc3d9c (patch)
treef1facb60eae12c62fc7801a7b793a4cc7c1e3588 /app
parent54901541e35b29fcdc05cf036b1eeb203df7bd7d (diff)
switch to turbo
Diffstat (limited to 'app')
-rw-r--r--app/controllers/pages_controller.rb4
-rw-r--r--app/javascript/packs/application.js3
-rw-r--r--app/views/machines/index.html.erb2
-rw-r--r--app/views/players/index.html.erb2
4 files changed, 6 insertions, 5 deletions
diff --git a/app/controllers/pages_controller.rb b/app/controllers/pages_controller.rb
index 2c454f9..923edf2 100644
--- a/app/controllers/pages_controller.rb
+++ b/app/controllers/pages_controller.rb
@@ -6,14 +6,14 @@ class PagesController < ApplicationController
   def teampicker
     @groups = maketeams
 
-    @machines = Machine.limit(@groups.count).order(Arel.sql("RANDOM()"))
+    @machines = Machine.limit(@groups.size).order(Arel.sql("RANDOM()"))
   end
 
   private
     def maketeams
       r = Player.where("strikes < 4").order(Arel.sql("RANDOM()")).to_a
 
-      groups = case r.count
+      groups = case r.size
         when 5
           [r.shift(3), r.shift(2)]
         when 6
diff --git a/app/javascript/packs/application.js b/app/javascript/packs/application.js
index 9cd55d4..9e9feba 100644
--- a/app/javascript/packs/application.js
+++ b/app/javascript/packs/application.js
@@ -4,7 +4,6 @@
 // that code so it'll be compiled.
 
 require("@rails/ujs").start()
-require("turbolinks").start()
 require("@rails/activestorage").start()
 require("channels")
 
@@ -15,3 +14,5 @@ require("channels")
 //
 // const images = require.context('../images', true)
 // const imagePath = (name) => images(name, true)
+
+import "@hotwired/turbo-rails"
diff --git a/app/views/machines/index.html.erb b/app/views/machines/index.html.erb
index 21717b9..33e279b 100644
--- a/app/views/machines/index.html.erb
+++ b/app/views/machines/index.html.erb
@@ -1,6 +1,6 @@
 <h1>Pinball Machines</h1>
 
-<p><%= @machines.count %> available machines</p>
+<p><%= @machines.size %> available machines</p>
 <ul>
   <% @machines.each do |machine| %>
     <li>
diff --git a/app/views/players/index.html.erb b/app/views/players/index.html.erb
index 744e1cd..7ad7944 100644
--- a/app/views/players/index.html.erb
+++ b/app/views/players/index.html.erb
@@ -1,6 +1,6 @@
 <h1>Pinball Players</h1>
 
-<p><%= @players.count %> available players</p>
+<p><%= @players.size %> available players</p>
 <ul>
   <% @players.each do |player| %>
     <li>