fix: Add slug column to parties table and update seed data
- Added slug column to parties table via migration - Updated seed data to properly assign slug values to Party records - Fixed NoMethodError when assigning slug attribute in seed file This resolves the ActiveModel::UnknownAttributeError that occurred when trying to set the slug attribute on Party model instances.
This commit is contained in:
@@ -12,7 +12,7 @@
|
||||
|
||||
<!-- Navigation Links -->
|
||||
<div class="hidden space-x-8 sm:-my-px sm:ms-10 sm:flex items-center">
|
||||
<%= link_to "Soirées et afterworks", events_path, class: "text-white hover:text-purple-200 px-3 py-2 rounded-md text-sm font-medium transition-colors duration-200" %>
|
||||
<%= link_to "Soirées et afterworks", parties_path, class: "text-white hover:text-purple-200 px-3 py-2 rounded-md text-sm font-medium transition-colors duration-200" %>
|
||||
<%= link_to "Concerts", "#", class: "text-white hover:text-purple-200 px-3 py-2 rounded-md text-sm font-medium transition-colors duration-200" %>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -167,9 +167,9 @@
|
||||
<div class="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-8">
|
||||
<% @parties.each do |party| %>
|
||||
<div class="bg-white border border-neutral-200 rounded-2xl overflow-hidden hover:transform hover:scale-105 transition-all duration-300 shadow-lg">
|
||||
<div class="h-56 bg-gradient-to-br from-purple-500 via-pink-500 to-red-500 relative"
|
||||
style="background-image: url('<%= party.image || "https://images.unsplash.com/photo-1506157786151-b84b9d3d78d8?ixlib=rb-4.0.3&auto=format&fit=crop&w=800&q=80" %>');
|
||||
background-size: cover;
|
||||
<div class="h-56 bg-gradient-to-br from-purple-500 via-pink-500 to-red-500 relative"
|
||||
style="background-image: url('<%= party.image || "https://images.unsplash.com/photo-1506157786151-b84b9d3d78d8?ixlib=rb-4.0.3&auto=format&fit=crop&w=800&q=80" %>');
|
||||
background-size: cover;
|
||||
background-position: center;">
|
||||
<div class="absolute top-4 right-4 bg-white bg-opacity-90 text-neutral-900 px-3 py-1 rounded-full text-sm font-medium">
|
||||
<%= party.venue_name.split(' ').first %>
|
||||
@@ -184,14 +184,14 @@
|
||||
</div>
|
||||
<p class="text-neutral-600 mb-2"><%= party.venue_name %>, <%= party.venue_address.split(',').first %></p>
|
||||
<p class="text-neutral-700 mb-4"><%= I18n.l(party.start_time, format: "%A %Hh") if party.start_time %> • <%= party.description.split('.').first %></p>
|
||||
<%= link_to "Réserver ma place", "#", class: "w-full bg-gradient-to-r from-purple-600 to-pink-600 hover:from-purple-700 hover:to-pink-700 text-white font-semibold py-3 rounded-lg transition-all duration-300 text-center block" %>
|
||||
<%= link_to "Voir les détails", party_path(party.slug, party), class: "w-full bg-gradient-to-r from-purple-600 to-pink-600 hover:from-purple-700 hover:to-pink-700 text-white font-semibold py-3 rounded-lg transition-all duration-300 text-center block" %>
|
||||
</div>
|
||||
</div>
|
||||
<% end %>
|
||||
</div>
|
||||
|
||||
<div class="text-center mt-12">
|
||||
<%= link_to "Voir tous les événements →", "#", class: "text-purple-600 hover:text-purple-700 text-lg font-medium transition-all duration-300 border-b-2 border-purple-600 hover:border-purple-700" %>
|
||||
<%= link_to "Voir tous les événements →", parties_path, class: "text-purple-600 hover:text-purple-700 text-lg font-medium transition-all duration-300 border-b-2 border-purple-600 hover:border-purple-700" %>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
37
app/views/parties/show.html.erb
Normal file
37
app/views/parties/show.html.erb
Normal file
@@ -0,0 +1,37 @@
|
||||
<div class="container mt-4">
|
||||
<div class="row">
|
||||
<div class="col-md-8">
|
||||
<h1><%= @party.name %></h1>
|
||||
|
||||
<% if @party.image.present? %>
|
||||
<%= image_tag @party.image, class: "img-fluid rounded mb-3" %>
|
||||
<% end %>
|
||||
|
||||
<p><%= @party.description %></p>
|
||||
|
||||
<div class="card mb-3">
|
||||
<div class="card-body">
|
||||
<h5 class="card-title">Event Details</h5>
|
||||
<p class="card-text">
|
||||
<strong>Venue:</strong> <%= @party.venue_name %><br>
|
||||
<strong>Address:</strong> <%= @party.venue_address %><br>
|
||||
<strong>Start Time:</strong> <%= @party.start_time.strftime("%B %d, %Y at %I:%M %p") %><br>
|
||||
<strong>End Time:</strong> <%= @party.end_time.strftime("%B %d, %Y at %I:%M %p") %>
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="col-md-4">
|
||||
<div class="card">
|
||||
<div class="card-body">
|
||||
<h5 class="card-title">Ticket Information</h5>
|
||||
<p class="card-text">
|
||||
<!-- Ticket types would go here -->
|
||||
<a href="#" class="btn btn-primary">Get Tickets</a>
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
Reference in New Issue
Block a user