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

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

Done #1121

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.
10 changes: 9 additions & 1 deletion config/routes.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,15 @@

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

get '/admin/stats', to: 'stats#index'
# get '/admin/stats', to: 'stats#index'

# scope "/admin", module: "admin" do
# resources :stats, only: [:index]
# end

namespace :admin do
resources :stats, only: [:index]
end

root 'posts#index'
end
36 changes: 36 additions & 0 deletions log/development.log
Original file line number Diff line number Diff line change
Expand Up @@ -4470,3 +4470,39 @@ 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)
DEPRECATION WARNING: ActiveRecord::Base.raise_in_transactional_callbacks= is deprecated, has no effect and will be removed without replacement. (called from <top (required)> at /Users/altversity/Documents/GitHub/namespaced-routes-reading-v-000/config/environment.rb:5)
Started GET "/" for ::1 at 2021-06-14 22:35:52 -0500
ActiveRecord::SchemaMigration Load (0.5ms) SELECT "schema_migrations".* FROM "schema_migrations"
Processing by PostsController#index as HTML
Rendering posts/index.html.erb within layouts/application
Post Load (0.5ms) SELECT "posts".* FROM "posts"
Author Load (0.5ms) 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 (47.9ms)
Completed 200 OK in 1388ms (Views: 1354.1ms | ActiveRecord: 2.3ms)


Started GET "/admin/stats" for ::1 at 2021-06-14 22:36:06 -0500
Processing by StatsController#index as HTML
 (0.7ms) 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 37ms (Views: 32.5ms | ActiveRecord: 0.9ms)


DEPRECATION WARNING: ActiveRecord::Base.raise_in_transactional_callbacks= is deprecated, has no effect and will be removed without replacement. (called from <top (required)> at /Users/altversity/Documents/GitHub/namespaced-routes-reading-v-000/config/environment.rb:5)
Started GET "/admin/stats" for ::1 at 2021-06-14 22:41:24 -0500
ActiveRecord::SchemaMigration Load (0.1ms) SELECT "schema_migrations".* FROM "schema_migrations"
Processing by Admin::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 admin/stats/index.html.erb within layouts/application
Rendered admin/stats/index.html.erb within layouts/application (2.2ms)
Completed 200 OK in 224ms (Views: 186.3ms | ActiveRecord: 0.9ms)


DEPRECATION WARNING: ActiveRecord::Base.raise_in_transactional_callbacks= is deprecated, has no effect and will be removed without replacement. (called from <top (required)> at /Users/altversity/Documents/GitHub/namespaced-routes-reading-v-000/config/environment.rb:5)
1 change: 0 additions & 1 deletion tmp/pids/server.pid

This file was deleted.