Skip to content

Commit

Permalink
Merge pull request #1157 from eip-ewi/fix-answer-sorting
Browse files Browse the repository at this point in the history
  • Loading branch information
ArtOfCode- authored Aug 2, 2023
2 parents ee95501 + 6762c07 commit cc99268
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions app/views/posts/show.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,10 @@
<h2><%= pluralize(@post.children.where(deleted: false).count, 'answer') %></h2>

<div class="button-list is-gutterless has-float-right">
<a href="<%= request.params.merge(sort: 'score') %>" class="button is-muted is-outlined <%= params[:sort].nil? || params[:sort] == 'score' ? 'is-active' : '' %>">Score</a>
<a href="<%= request.params.merge(sort: 'active') %>" class="button is-muted is-outlined <%= params[:sort] == 'active' ? 'is-active' : '' %>">Active</a>
<%= link_to 'Score', request.params.merge(sort: 'score'),
class: "button is-muted is-outlined #{params[:sort].nil? || params[:sort] == 'score' ? 'is-active' : ''}" %>
<%= link_to 'Active', request.params.merge(sort: 'active'),
class: "button is-muted is-outlined #{params[:sort] == 'active' ? 'is-active' : ''}" %>
</div>

<div class="has-clear-clear"></div>
Expand Down

0 comments on commit cc99268

Please sign in to comment.