Files
danbooru/app/views/recommended_posts/_index.html.erb
evazion 1b30b71a07 posts: refactor post previews to use ViewComponent.
Refactor the post preview html to use the ViewComponent framework. This
lets us encapsulate all the HTML, CSS, and helper methods for a UI
component in a single place.

See https://viewcomponent.org.
2021-01-14 21:17:57 -06:00

10 lines
293 B
Plaintext

<section class="recommended-posts user-disable-cropped-<%= CurrentUser.user.disable_cropped_thumbnails? %>">
<% if @recs.empty? %>
No recommendations found.
<% end %>
<% @recs.each do |rec| %>
<%= post_preview(rec[:post], recommended: 100*rec[:score]) %>
<% end %>
</section>