class Admin::CommentsController < Admin::AdminController before_action :set_section def index @comments = Comment.order(updated_at: :desc).paginate(page: params[:page], per_page: 20) end def destroy if Comment.destroy(params[:id]) flash.notice = "Comment successfully deleted." else flash.alert = "Could not delete comment." end redirect_to admin_comments_url end private def set_section @section = "comments" end end