diff options
| author | mo khan <mo@mokhan.ca> | 2014-01-18 23:26:44 -0700 |
|---|---|---|
| committer | mo khan <mo@mokhan.ca> | 2014-01-18 23:26:44 -0700 |
| commit | 140f058d047efda322490f3910f486bb49ab1445 (patch) | |
| tree | e18facd235b2e32f6ed9494661d1941c3dfe6482 /app/controllers/admin | |
| parent | 5909a73e78b1b2501c6f732f0c76279c7b1c7f1e (diff) | |
add an admin page to view activity.
Diffstat (limited to 'app/controllers/admin')
| -rw-r--r-- | app/controllers/admin/activities_controller.rb | 8 | ||||
| -rw-r--r-- | app/controllers/admin/users_controller.rb | 1 |
2 files changed, 9 insertions, 0 deletions
diff --git a/app/controllers/admin/activities_controller.rb b/app/controllers/admin/activities_controller.rb new file mode 100644 index 00000000..43dece54 --- /dev/null +++ b/app/controllers/admin/activities_controller.rb @@ -0,0 +1,8 @@ +module Admin + class ActivitiesController < AdminController + def index + @recent_activities = Activity.order(:created_at => :desc).limit(100) + expires_in(10.minutes) + end + end +end diff --git a/app/controllers/admin/users_controller.rb b/app/controllers/admin/users_controller.rb index 03f0aef6..bd2da01a 100644 --- a/app/controllers/admin/users_controller.rb +++ b/app/controllers/admin/users_controller.rb @@ -4,6 +4,7 @@ module Admin @users = User.includes(:avatar).order(:created_at => :desc) @recent_users = @users.limit(10) @active_users = @users.order(:updated_at).limit(10) + @recent_activities = Activity.order(:created_at => :desc).limit(10) expires_in(10.minutes) end end |
