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.
10 lines
293 B
Plaintext
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>
|