- Update cities controller to include state in city data - Modify results partial to pass pagination parameters - Adjust index view to support turbo frame actions These changes improve the pagination functionality by ensuring that the correct parameters are passed for filtering cities based on region, country, and state. This enhances the user experience by providing more relevant data and better navigation through the city listings.
30 lines
1.2 KiB
Plaintext
30 lines
1.2 KiB
Plaintext
<!-- app/views/cities/_results.html.erb -->
|
|
<div class="container mx-auto px-4 py-8">
|
|
<% if cities.empty? %>
|
|
<div class="text-center py-16">
|
|
<div class="text-base-content/50">
|
|
<svg class="w-16 h-16 mx-auto mb-4" xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke="currentColor">
|
|
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M19 20H5a2 2 0 01-2-2V6a2 2 0 012-2h10a2 2 0 012 2v1m2 13a2 2 0 01-2-2V7m2 13a2 2 0 002-2V9a2 2 0 00-2-2h-2m-4-3H9M7 16h6M7 8h6v4H7V8z" />
|
|
</svg>
|
|
<h3 class="text-xl font-semibold mb-2"><%= t('.no_results_title') %></h3>
|
|
<p class="text-base-content/70">
|
|
<%= t('.no_results_message') %>
|
|
</p>
|
|
</div>
|
|
</div>
|
|
<% else %>
|
|
<div class="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-8">
|
|
<%= render partial: 'city', collection: cities %>
|
|
</div>
|
|
|
|
<%= render 'shared/pagination',
|
|
collection: cities,
|
|
collection_name: 'cities',
|
|
pagination_params: {
|
|
region: params[:region],
|
|
country: params[:country],
|
|
state: params[:state],
|
|
query: params[:query]
|
|
} %>
|
|
<% end %>
|
|
</div> |