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..9111a38e6 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