From 9301dd95eacfd786444c017f141522f79eb86789 Mon Sep 17 00:00:00 2001 From: Tyler Sell Date: Thu, 9 Apr 2020 16:36:33 +0000 Subject: [PATCH] Done. --- app/controllers/{ => admin}/stats_controller.rb | 2 +- app/views/{ => admin}/stats/index.html.erb | 0 config/routes.rb | 6 ++++-- 3 files changed, 5 insertions(+), 3 deletions(-) rename app/controllers/{ => admin}/stats_controller.rb (68%) rename app/views/{ => admin}/stats/index.html.erb (100%) diff --git a/app/controllers/stats_controller.rb b/app/controllers/admin/stats_controller.rb similarity index 68% rename from app/controllers/stats_controller.rb rename to app/controllers/admin/stats_controller.rb index d155f327b..8b71e2a34 100644 --- a/app/controllers/stats_controller.rb +++ b/app/controllers/admin/stats_controller.rb @@ -1,4 +1,4 @@ -class StatsController < ApplicationController +class Admin::StatsController < ApplicationController def index @post_count = Post.count diff --git a/app/views/stats/index.html.erb b/app/views/admin/stats/index.html.erb similarity index 100% rename from app/views/stats/index.html.erb rename to app/views/admin/stats/index.html.erb diff --git a/config/routes.rb b/config/routes.rb index 66d8f171b..c0304d99b 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -5,7 +5,9 @@ resources :posts, only: %i[index show new create edit update] - get '/admin/stats', to: 'stats#index' - + namespace :admin do + resources :stats, only: [:index] + end + root 'posts#index' end