Skip to content

Commit

Permalink
Remove fragment cache
Browse files Browse the repository at this point in the history
  • Loading branch information
jahseng-lee committed May 25, 2024
1 parent f197925 commit c1a4aeb
Showing 1 changed file with 34 additions and 36 deletions.
70 changes: 34 additions & 36 deletions app/views/search_locations/_location_search_section.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -109,49 +109,47 @@
<div id="search-results">
<div class="row row-cols-xl-3 row-cols-md-2 row-cols-1">
<% @locations.each do |location| %>
<% cache location do %>
<div class="col">
<%= link_to location, class: "location-search-result-link" do %>
<div class="location-card card overflow-hidden mb-3">
<div class="row g-0">
<div class="col-md-4">
<img
src="<%= helper_location_thumbnail(location: location) %>"
class="search-result-img img-fluid rounded-start"
alt="Photo of <%= location.name_utf8 %>">
<div class="col">
<%= link_to location, class: "location-search-result-link" do %>
<div class="location-card card overflow-hidden mb-3">
<div class="row g-0">
<div class="col-md-4">
<img
src="<%= helper_location_thumbnail(location: location) %>"
class="search-result-img img-fluid rounded-start"
alt="Photo of <%= location.name_utf8 %>">
</div>
<div class="col-md-8">
<div class="card-body">
<p class="card-title h5"><%= location.name_utf8 %></p>
<p class="card-subtitle h6 mb-2 text-body-secondary"><%= location.country_name %></p>
<p class="card-text">
<%= helper_location_short_description(
location: location
) %>
</p>
</div>
<div class="col-md-8">
<div class="card-body">
<p class="card-title h5"><%= location.name_utf8 %></p>
<p class="card-subtitle h6 mb-2 text-body-secondary"><%= location.country_name %></p>
<p class="card-text">
<%= helper_location_short_description(
location: location
) %>
</p>
</div>

<div class="card-footer">
<%= render partial: "shared/location_tags", locals: {
location: location
} %>
<div class="card-footer">
<%= render partial: "shared/location_tags", locals: {
location: location
} %>

<% if location.tags.any? && location.reviews.any? %>
<hr />
<% end %>
<% if location.tags.any? && location.reviews.any? %>
<hr />
<% end %>

<% if location.reviews.any? %>
<div>
<%= helper_review_overall_summary_star_rating(
location: location
) %>
</div>
<% end %>
</div>
<% if location.reviews.any? %>
<div>
<%= helper_review_overall_summary_star_rating(
location: location
) %>
</div>
<% end %>
</div>
</div>
</div>
<% end %>
</div>
</div>
<% end %>
<% end %>
Expand Down

0 comments on commit c1a4aeb

Please sign in to comment.