After looking at this UI in production, I realized that showing only five negative reactions per page was way too few! Bumping this up to 25 which I feel is more reasonable.
15 lines
451 B
Ruby
15 lines
451 B
Ruby
class Internal::NegativeReactionsController < Internal::ApplicationController
|
|
layout "internal"
|
|
|
|
NEGATIVE_REACTION_CATEGORIES = %i[vomit thumbsdown].freeze
|
|
|
|
def index
|
|
@q = Reaction.
|
|
includes(:user,
|
|
:reactable).
|
|
where("category IN (?)", NEGATIVE_REACTION_CATEGORIES).
|
|
order("reactions.created_at DESC").
|
|
ransack(params[:q])
|
|
@negative_reactions = @q.result.page(params[:page] || 1).per(25)
|
|
end
|
|
end
|