Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Done #1102

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Done #1102

Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
class StatsController < ApplicationController
class Admin::StatsController < ApplicationController

def index
@post_count = Post.count
Expand Down
File renamed without changes.
6 changes: 5 additions & 1 deletion config/routes.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,11 @@

resources :posts, only: %i[index show new create edit update]

get '/admin/stats', to: 'stats#index'
namespace :admin do
resources :stats, only: [:index]
end

#namespace method makes the assumption that the path prefix and module name match

root 'posts#index'
end
162 changes: 162 additions & 0 deletions log/development.log
Original file line number Diff line number Diff line change
Expand Up @@ -4470,3 +4470,165 @@ 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 172.115.217.51 at 2020-05-29 04:03:16 +0000
Cannot render console from 172.115.217.51! Allowed networks: 127.0.0.1, ::1, 127.0.0.0/127.255.255.255
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 <class:Railtie> at /usr/local/rvm/gems/ruby-2.6.1/gems/activerecord-5.0.7.2/lib/active_record/railtie.rb:113)
ActiveRecord::SchemaMigration Load (0.2ms) 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.1ms) SELECT "authors".* FROM "authors" WHERE "authors"."id" = ? LIMIT ? [["id", 3], ["LIMIT", 1]]
Rendered posts/index.html.erb within layouts/application (57.1ms)
Completed 200 OK in 694ms (Views: 675.2ms | ActiveRecord: 1.9ms)


Started GET "/assets/authors.self-e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855.css?body=1" for 172.115.217.51 at 2020-05-29 04:03:18 +0000
Cannot render console from 172.115.217.51! Allowed networks: 127.0.0.1, ::1, 127.0.0.0/127.255.255.255
Started GET "/assets/application.self-e80e8f2318043e8af94dddc2adad5a4f09739a8ebb323b3ab31cd71d45fd9113.css?body=1" for 172.115.217.51 at 2020-05-29 04:03:18 +0000
Cannot render console from 172.115.217.51! Allowed networks: 127.0.0.1, ::1, 127.0.0.0/127.255.255.255
Started GET "/assets/jquery.self-bd7ddd393353a8d2480a622e80342adf488fb6006d667e8b42e4c0073393abee.js?body=1" for 172.115.217.51 at 2020-05-29 04:03:18 +0000
Cannot render console from 172.115.217.51! Allowed networks: 127.0.0.1, ::1, 127.0.0.0/127.255.255.255
Started GET "/assets/turbolinks.self-569ee74eaa15c1e2019317ff770b8769b1ec033a0f572a485f64c82ddc8f989e.js?body=1" for 172.115.217.51 at 2020-05-29 04:03:18 +0000
Cannot render console from 172.115.217.51! Allowed networks: 127.0.0.1, ::1, 127.0.0.0/127.255.255.255
Started GET "/assets/jquery_ujs.self-784a997f6726036b1993eb2217c9cb558e1cbb801c6da88105588c56f13b466a.js?body=1" for 172.115.217.51 at 2020-05-29 04:03:18 +0000
Cannot render console from 172.115.217.51! Allowed networks: 127.0.0.1, ::1, 127.0.0.0/127.255.255.255
Started GET "/assets/application.self-3b8dabdc891efe46b9a144b400ad69e37d7e5876bdc39dee783419a69d7ca819.js?body=1" for 172.115.217.51 at 2020-05-29 04:03:18 +0000
Cannot render console from 172.115.217.51! Allowed networks: 127.0.0.1, ::1, 127.0.0.0/127.255.255.255
Started GET "/assets/authors.self-877aef30ae1b040ab8a3aba4e3e309a11d7f2612f44dde450b5c157aa5f95c05.js?body=1" for 172.115.217.51 at 2020-05-29 04:03:18 +0000
Cannot render console from 172.115.217.51! Allowed networks: 127.0.0.1, ::1, 127.0.0.0/127.255.255.255
Started GET "/admin/stats" for 172.115.217.51 at 2020-05-29 04:03:29 +0000
Cannot render console from 172.115.217.51! Allowed networks: 127.0.0.1, ::1, 127.0.0.0/127.255.255.255
Processing by StatsController#index as HTML
 (0.2ms) 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 stats/index.html.erb within layouts/application
Rendered stats/index.html.erb within layouts/application (0.6ms)
Completed 200 OK in 30ms (Views: 27.6ms | ActiveRecord: 0.4ms)


Started GET "/admin/" for 172.115.217.51 at 2020-05-29 04:03:32 +0000
Cannot render console from 172.115.217.51! Allowed networks: 127.0.0.1, ::1, 127.0.0.0/127.255.255.255

ActionController::RoutingError (No route matches [GET] "/admin"):

actionpack (5.0.7.2) lib/action_dispatch/middleware/debug_exceptions.rb:53:in `call'
web-console (2.3.0) lib/web_console/middleware.rb:20:in `block in call'
web-console (2.3.0) lib/web_console/middleware.rb:18:in `catch'
web-console (2.3.0) lib/web_console/middleware.rb:18:in `call'
actionpack (5.0.7.2) lib/action_dispatch/middleware/show_exceptions.rb:31:in `call'
railties (5.0.7.2) lib/rails/rack/logger.rb:36:in `call_app'
railties (5.0.7.2) lib/rails/rack/logger.rb:24:in `block in call'
activesupport (5.0.7.2) lib/active_support/tagged_logging.rb:69:in `block in tagged'
activesupport (5.0.7.2) lib/active_support/tagged_logging.rb:26:in `tagged'
activesupport (5.0.7.2) lib/active_support/tagged_logging.rb:69:in `tagged'
railties (5.0.7.2) lib/rails/rack/logger.rb:24:in `call'
actionpack (5.0.7.2) lib/action_dispatch/middleware/request_id.rb:24:in `call'
rack (2.2.2) lib/rack/method_override.rb:24:in `call'
rack (2.2.2) lib/rack/runtime.rb:22:in `call'
activesupport (5.0.7.2) lib/active_support/cache/strategy/local_cache_middleware.rb:28:in `call'
actionpack (5.0.7.2) lib/action_dispatch/middleware/executor.rb:12:in `call'
actionpack (5.0.7.2) lib/action_dispatch/middleware/static.rb:136:in `call'
rack (2.2.2) lib/rack/sendfile.rb:110:in `call'
railties (5.0.7.2) lib/rails/engine.rb:522:in `call'
rack (2.2.2) lib/rack/handler/webrick.rb:95:in `service'
/usr/local/rvm/rubies/ruby-2.6.1/lib/ruby/2.6.0/webrick/httpserver.rb:140:in `service'
/usr/local/rvm/rubies/ruby-2.6.1/lib/ruby/2.6.0/webrick/httpserver.rb:96:in `run'
/usr/local/rvm/rubies/ruby-2.6.1/lib/ruby/2.6.0/webrick/server.rb:307:in `block in start_thread'
Rendering /usr/local/rvm/gems/ruby-2.6.1/gems/actionpack-5.0.7.2/lib/action_dispatch/middleware/templates/rescues/routing_error.html.erb within rescues/layout
Rendering /usr/local/rvm/gems/ruby-2.6.1/gems/actionpack-5.0.7.2/lib/action_dispatch/middleware/templates/rescues/_trace.html.erb
Rendered /usr/local/rvm/gems/ruby-2.6.1/gems/actionpack-5.0.7.2/lib/action_dispatch/middleware/templates/rescues/_trace.html.erb (3.8ms)
Rendered collection of /usr/local/rvm/gems/ruby-2.6.1/gems/actionpack-5.0.7.2/lib/action_dispatch/middleware/templates/routes/_route.html.erb [15 times] (18.4ms)
Rendered /usr/local/rvm/gems/ruby-2.6.1/gems/actionpack-5.0.7.2/lib/action_dispatch/middleware/templates/routes/_table.html.erb (17.7ms)
Rendering /usr/local/rvm/gems/ruby-2.6.1/gems/actionpack-5.0.7.2/lib/action_dispatch/middleware/templates/rescues/_request_and_response.html.erb
Rendered /usr/local/rvm/gems/ruby-2.6.1/gems/actionpack-5.0.7.2/lib/action_dispatch/middleware/templates/rescues/_request_and_response.html.erb (1.1ms)
Rendered /usr/local/rvm/gems/ruby-2.6.1/gems/actionpack-5.0.7.2/lib/action_dispatch/middleware/templates/rescues/routing_error.html.erb within rescues/layout (76.4ms)
Started GET "/" for 172.115.217.51 at 2020-05-29 04:09:36 +0000
Cannot render console from 172.115.217.51! Allowed networks: 127.0.0.1, ::1, 127.0.0.0/127.255.255.255
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 <class:Railtie> at /usr/local/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.1ms) SELECT "authors".* FROM "authors" WHERE "authors"."id" = ? LIMIT ? [["id", 3], ["LIMIT", 1]]
Rendered posts/index.html.erb within layouts/application (56.5ms)
Completed 200 OK in 240ms (Views: 216.8ms | ActiveRecord: 4.3ms)


Started GET "/admin/stats" for 172.115.217.51 at 2020-05-29 04:09:44 +0000
Cannot render console from 172.115.217.51! Allowed networks: 127.0.0.1, ::1, 127.0.0.0/127.255.255.255

ActionController::RoutingError (uninitialized constant StatsController):

activesupport (5.0.7.2) lib/active_support/inflector/methods.rb:268:in `const_get'
activesupport (5.0.7.2) lib/active_support/inflector/methods.rb:268:in `block in constantize'
activesupport (5.0.7.2) lib/active_support/inflector/methods.rb:266:in `each'
activesupport (5.0.7.2) lib/active_support/inflector/methods.rb:266:in `inject'
activesupport (5.0.7.2) lib/active_support/inflector/methods.rb:266:in `constantize'
actionpack (5.0.7.2) lib/action_dispatch/http/request.rb:81:in `controller_class'
actionpack (5.0.7.2) lib/action_dispatch/routing/route_set.rb:44:in `controller'
actionpack (5.0.7.2) lib/action_dispatch/routing/route_set.rb:30:in `serve'
actionpack (5.0.7.2) lib/action_dispatch/journey/router.rb:39:in `block in serve'
actionpack (5.0.7.2) lib/action_dispatch/journey/router.rb:26:in `each'
actionpack (5.0.7.2) lib/action_dispatch/journey/router.rb:26:in `serve'
actionpack (5.0.7.2) lib/action_dispatch/routing/route_set.rb:727:in `call'
rack (2.2.2) lib/rack/etag.rb:27:in `call'
rack (2.2.2) lib/rack/conditional_get.rb:27:in `call'
rack (2.2.2) lib/rack/head.rb:12:in `call'
rack (2.2.2) lib/rack/session/abstract/id.rb:266:in `context'
rack (2.2.2) lib/rack/session/abstract/id.rb:260:in `call'
actionpack (5.0.7.2) lib/action_dispatch/middleware/cookies.rb:613:in `call'
activerecord (5.0.7.2) lib/active_record/migration.rb:553:in `call'
actionpack (5.0.7.2) lib/action_dispatch/middleware/callbacks.rb:38:in `block in call'
activesupport (5.0.7.2) lib/active_support/callbacks.rb:97:in `__run_callbacks__'
activesupport (5.0.7.2) lib/active_support/callbacks.rb:750:in `_run_call_callbacks'
activesupport (5.0.7.2) lib/active_support/callbacks.rb:90:in `run_callbacks'
actionpack (5.0.7.2) lib/action_dispatch/middleware/callbacks.rb:36:in `call'
actionpack (5.0.7.2) lib/action_dispatch/middleware/executor.rb:12:in `call'
actionpack (5.0.7.2) lib/action_dispatch/middleware/remote_ip.rb:79:in `call'
actionpack (5.0.7.2) lib/action_dispatch/middleware/debug_exceptions.rb:49:in `call'
web-console (2.3.0) lib/web_console/middleware.rb:20:in `block in call'
web-console (2.3.0) lib/web_console/middleware.rb:18:in `catch'
web-console (2.3.0) lib/web_console/middleware.rb:18:in `call'
actionpack (5.0.7.2) lib/action_dispatch/middleware/show_exceptions.rb:31:in `call'
railties (5.0.7.2) lib/rails/rack/logger.rb:36:in `call_app'
railties (5.0.7.2) lib/rails/rack/logger.rb:24:in `block in call'
activesupport (5.0.7.2) lib/active_support/tagged_logging.rb:69:in `block in tagged'
activesupport (5.0.7.2) lib/active_support/tagged_logging.rb:26:in `tagged'
activesupport (5.0.7.2) lib/active_support/tagged_logging.rb:69:in `tagged'
railties (5.0.7.2) lib/rails/rack/logger.rb:24:in `call'
actionpack (5.0.7.2) lib/action_dispatch/middleware/request_id.rb:24:in `call'
rack (2.2.2) lib/rack/method_override.rb:24:in `call'
rack (2.2.2) lib/rack/runtime.rb:22:in `call'
activesupport (5.0.7.2) lib/active_support/cache/strategy/local_cache_middleware.rb:28:in `call'
actionpack (5.0.7.2) lib/action_dispatch/middleware/executor.rb:12:in `call'
actionpack (5.0.7.2) lib/action_dispatch/middleware/static.rb:136:in `call'
rack (2.2.2) lib/rack/sendfile.rb:110:in `call'
railties (5.0.7.2) lib/rails/engine.rb:522:in `call'
rack (2.2.2) lib/rack/handler/webrick.rb:95:in `service'
/usr/local/rvm/rubies/ruby-2.6.1/lib/ruby/2.6.0/webrick/httpserver.rb:140:in `service'
/usr/local/rvm/rubies/ruby-2.6.1/lib/ruby/2.6.0/webrick/httpserver.rb:96:in `run'
/usr/local/rvm/rubies/ruby-2.6.1/lib/ruby/2.6.0/webrick/server.rb:307:in `block in start_thread'
Rendering /usr/local/rvm/gems/ruby-2.6.1/gems/actionpack-5.0.7.2/lib/action_dispatch/middleware/templates/rescues/routing_error.html.erb within rescues/layout
Rendering /usr/local/rvm/gems/ruby-2.6.1/gems/actionpack-5.0.7.2/lib/action_dispatch/middleware/templates/rescues/_trace.html.erb
Rendered /usr/local/rvm/gems/ruby-2.6.1/gems/actionpack-5.0.7.2/lib/action_dispatch/middleware/templates/rescues/_trace.html.erb (1.6ms)
Rendered collection of /usr/local/rvm/gems/ruby-2.6.1/gems/actionpack-5.0.7.2/lib/action_dispatch/middleware/templates/routes/_route.html.erb [15 times] (5.2ms)
Rendered /usr/local/rvm/gems/ruby-2.6.1/gems/actionpack-5.0.7.2/lib/action_dispatch/middleware/templates/routes/_table.html.erb (6.9ms)
Rendering /usr/local/rvm/gems/ruby-2.6.1/gems/actionpack-5.0.7.2/lib/action_dispatch/middleware/templates/rescues/_request_and_response.html.erb
Rendered /usr/local/rvm/gems/ruby-2.6.1/gems/actionpack-5.0.7.2/lib/action_dispatch/middleware/templates/rescues/_request_and_response.html.erb (1.1ms)
Rendered /usr/local/rvm/gems/ruby-2.6.1/gems/actionpack-5.0.7.2/lib/action_dispatch/middleware/templates/rescues/routing_error.html.erb within rescues/layout (29.1ms)
Started GET "/admin/stats" for 172.115.217.51 at 2020-05-29 04:10:15 +0000
Cannot render console from 172.115.217.51! Allowed networks: 127.0.0.1, ::1, 127.0.0.0/127.255.255.255
Processing by Admin::StatsController#index as HTML
 (0.1ms) SELECT COUNT(*) FROM "posts"
 (0.1ms) SELECT COUNT(*) FROM "authors"
Post Load (0.2ms) 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 (0.7ms)
Completed 200 OK in 28ms (Views: 11.3ms | ActiveRecord: 1.6ms)


1 change: 0 additions & 1 deletion tmp/pids/server.pid

This file was deleted.