Rails-8-API-Image-Processing / app /controllers /admin /dashboard_controller.rb
denise-oneill-inbox-ru's picture
D8 staging from 92665ef4298ecff6735b080ff7901f2c19f719a7
5010ad7 verified
Raw History Blame Contribute Delete
466 Bytes
module Admin
class DashboardController < AdminController
def index
@post_count = Post.count
@published_count = Post.published.count
@user_count = User.count
@comment_count = Comment.kept.count
@category_count = Category.count
@tag_count = Tag.count
@recent_posts = Post.order(created_at: :desc).limit(5)
@recent_comments = Comment.kept.includes(:user, :post).order(created_at: :desc).limit(5)
end
end
end