From bb87573a5320257a21533b30c7cb81b948e86a49 Mon Sep 17 00:00:00 2001 From: Kang-Kyu Lee Date: Tue, 2 Jul 2024 00:43:13 -0700 Subject: [PATCH] Add 'Go vote' button; bump ruby 3.1 to 3.2 --- .ruby-version | 2 +- Gemfile | 4 ++-- Gemfile.lock | 10 +++++++--- app/views/rounds/show.html.erb | 6 +++++- 4 files changed, 15 insertions(+), 7 deletions(-) diff --git a/.ruby-version b/.ruby-version index 9cec716..351227f 100644 --- a/.ruby-version +++ b/.ruby-version @@ -1 +1 @@ -3.1.6 +3.2.4 diff --git a/Gemfile b/Gemfile index a2054a6..be8dd5b 100644 --- a/Gemfile +++ b/Gemfile @@ -1,7 +1,7 @@ source "https://rubygems.org" git_source(:github) { |repo| "https://github.com/#{repo}.git" } -ruby "3.1.6" +ruby "3.2.4" # Bundle edge Rails instead: gem "rails", github: "rails/rails", branch: "main" gem "rails", "~> 7.0.2", ">= 7.0.2.4" @@ -28,7 +28,7 @@ gem "stimulus-rails" gem "jbuilder" # Use Redis adapter to run Action Cable in production -gem "redis", "~> 4.0" +gem "redis", "~> 5.0.8" # Use Kredis to get higher-level data types in Redis [https://github.com/rails/kredis] # gem "kredis" diff --git a/Gemfile.lock b/Gemfile.lock index a7418a7..ba326b4 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -84,6 +84,7 @@ GEM xpath (~> 3.2) coderay (1.1.3) concurrent-ruby (1.2.2) + connection_pool (2.4.1) crass (1.0.6) date (3.3.3) debug (1.8.0) @@ -173,7 +174,10 @@ GEM thor (~> 1.0) zeitwerk (~> 2.5) rake (13.0.6) - redis (4.8.1) + redis (5.0.8) + redis-client (>= 0.17.0) + redis-client (0.22.2) + connection_pool regexp_parser (2.8.1) reline (0.3.8) io-console (~> 0.5) @@ -237,7 +241,7 @@ DEPENDENCIES pry-rails puma (~> 5.0) rails (~> 7.0.2, >= 7.0.2.4) - redis (~> 4.0) + redis (~> 5.0.8) selenium-webdriver sprockets-rails stimulus-rails @@ -248,7 +252,7 @@ DEPENDENCIES webdrivers RUBY VERSION - ruby 3.1.6p260 + ruby 3.2.4p170 BUNDLED WITH 2.3.26 diff --git a/app/views/rounds/show.html.erb b/app/views/rounds/show.html.erb index 58b8e01..48361a5 100644 --- a/app/views/rounds/show.html.erb +++ b/app/views/rounds/show.html.erb @@ -12,9 +12,13 @@ <% else %>

User <%= @round.owner.username %> started it

- <% if !current_user.audience?(@round) %> +
+ <% if current_user.audience?(@round) %> + <%= link_to 'Go vote', round_contestants_path(@round), method: :get, class: "bg-transparent hover:bg-indigo-500 text-indigo-700 font-semibold hover:text-white py-2 px-4 border border-indigo-500 hover:border-transparent rounded" %> + <% else %> <%= button_to "Join the audience", new_round_audience_path(@round), method: :get, class: "bg-blue-500 hover:bg-blue-700 text-white font-bold py-2 px-4" %> <% end %> +
<% end %>