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..a71e62f78 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -4,8 +4,11 @@ end resources :posts, only: %i[index show new create edit update] + + root 'posts#index' - get '/admin/stats', to: 'stats#index' + namespace :admin do + resources :stats, only: [:index] + end - root 'posts#index' end