Answer the question
In order to leave comments, you need to log in
How to pin a comment to the top of the list of all comments?
Hello. The comment has a boolean value, if it is true, then you need to pin it to the top of all comments. Like on a toaster. What to use? How to do this?
Answer the question
In order to leave comments, you need to log in
@top_comments = @comments.where(top: true)
<div class='top comment'>
<%= render @top_comment %>
</div>
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question