From 71cd9d507b38756bae27fbcd7cced3297ebec33b Mon Sep 17 00:00:00 2001 From: Eugene Burmakin Date: Thu, 28 Nov 2024 15:58:30 +0100 Subject: [PATCH] Make each card a link and add hover effect --- app/views/trips/index.html.erb | 40 ++++++++++++++++++---------------- 1 file changed, 21 insertions(+), 19 deletions(-) diff --git a/app/views/trips/index.html.erb b/app/views/trips/index.html.erb index 46218299..eb0c2078 100644 --- a/app/views/trips/index.html.erb +++ b/app/views/trips/index.html.erb @@ -27,28 +27,30 @@
<% @trips.each do |trip| %> -
-
-

- <%= link_to trip.name, trip, class: 'hover:underline' %> -

-

- <%= "#{human_date(trip.started_at)} – #{human_date(trip.ended_at)}, #{trip.distance} #{DISTANCE_UNIT}" %> -

+ <%= link_to trip, class: "block hover:shadow-lg rounded-lg" do %> +
+
+

+ <%= trip.name %> +

+

+ <%= "#{human_date(trip.started_at)} – #{human_date(trip.ended_at)}, #{trip.distance} #{DISTANCE_UNIT}" %> +

-
+
+
-
+ <% end %> <% end %>
<% end %>