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 #1104

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

Done #1104

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.
4 changes: 3 additions & 1 deletion config/routes.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
33 changes: 33 additions & 0 deletions log/development.log
Original file line number Diff line number Diff line change
Expand Up @@ -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 <class:Railtie> 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)


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

This file was deleted.