diff options
Diffstat (limited to 'app')
-rw-r--r-- | app/controllers/pages_controller.rb | 4 | ||||
-rw-r--r-- | app/javascript/packs/application.js | 3 | ||||
-rw-r--r-- | app/views/machines/index.html.erb | 2 | ||||
-rw-r--r-- | app/views/players/index.html.erb | 2 |
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> |