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 diff --git a/log/development.log b/log/development.log index c60621744..f9da5b514 100644 --- a/log/development.log +++ b/log/development.log @@ -4470,3 +4470,36 @@ ActionController::RoutingError (No route matches [GET] "/stats"): Rendered /Users/scottcreynolds/.rvm/gems/ruby-2.1.2/gems/web-console-2.2.1/lib/web_console/templates/main.js.erb within layouts/javascript (0.2ms) Rendered /Users/scottcreynolds/.rvm/gems/ruby-2.1.2/gems/web-console-2.2.1/lib/web_console/templates/error_page.js.erb within layouts/javascript (0.4ms) Rendered /Users/scottcreynolds/.rvm/gems/ruby-2.1.2/gems/web-console-2.2.1/lib/web_console/templates/index.html.erb (34.6ms) +Started GET "/" for ::1 at 2020-06-25 22:39:44 -0400 +DEPRECATION WARNING: ActiveRecord::Base.raise_in_transactional_callbacks= is deprecated, has no effect and will be removed without replacement. (called from block (3 levels) in at /Users/mbeebe/.rvm/gems/ruby-2.6.1/gems/activerecord-5.0.7.2/lib/active_record/railtie.rb:113) + ActiveRecord::SchemaMigration Load (0.3ms) SELECT "schema_migrations".* FROM "schema_migrations" +Processing by PostsController#index as HTML + Rendering posts/index.html.erb within layouts/application + Post Load (0.2ms) SELECT "posts".* FROM "posts" + Author Load (0.2ms) SELECT "authors".* FROM "authors" WHERE "authors"."id" = ? LIMIT ? [["id", 1], ["LIMIT", 1]] + Author Load (0.1ms) SELECT "authors".* FROM "authors" WHERE "authors"."id" = ? LIMIT ? [["id", 2], ["LIMIT", 1]] + Author Load (0.0ms) SELECT "authors".* FROM "authors" WHERE "authors"."id" = ? LIMIT ? [["id", 3], ["LIMIT", 1]] + Rendered posts/index.html.erb within layouts/application (23.9ms) +Completed 200 OK in 729ms (Views: 717.9ms | ActiveRecord: 1.2ms) + + +Started GET "/admin/stats" for ::1 at 2020-06-25 22:39:48 -0400 +Processing by Admin::StatsController#index as HTML +  (0.1ms) SELECT COUNT(*) FROM "posts" +  (0.1ms) SELECT COUNT(*) FROM "authors" + Post Load (0.1ms) SELECT "posts".* FROM "posts" ORDER BY "posts"."id" DESC LIMIT ? [["LIMIT", 1]] + Rendering admin/stats/index.html.erb within layouts/application + Rendered admin/stats/index.html.erb within layouts/application (1.0ms) +Completed 200 OK in 19ms (Views: 15.3ms | ActiveRecord: 0.3ms) + + +Started GET "/admin/stats" for ::1 at 2020-06-25 22:40:32 -0400 +Processing by Admin::StatsController#index as HTML +  (0.1ms) SELECT COUNT(*) FROM "posts" +  (0.1ms) SELECT COUNT(*) FROM "authors" + Post Load (0.1ms) SELECT "posts".* FROM "posts" ORDER BY "posts"."id" DESC LIMIT ? [["LIMIT", 1]] + Rendering admin/stats/index.html.erb within layouts/application + Rendered admin/stats/index.html.erb within layouts/application (1.2ms) +Completed 200 OK in 24ms (Views: 10.3ms | ActiveRecord: 1.3ms) + + diff --git a/tmp/pids/server.pid b/tmp/pids/server.pid deleted file mode 100644 index 1ca13651f..000000000 --- a/tmp/pids/server.pid +++ /dev/null @@ -1 +0,0 @@ -33801 \ No newline at end of file