diff options
| author | mo khan <mo@mokhan.ca> | 2013-12-31 21:38:12 -0700 |
|---|---|---|
| committer | mo khan <mo@mokhan.ca> | 2013-12-31 21:38:12 -0700 |
| commit | c7ab870f7acaa337dbd3f94a1a99b3a9267c2493 (patch) | |
| tree | 5e89a365331718c42abdca7cc455b8ba3eae5c2a /app/controllers/application_controller.rb | |
| parent | 6ba0fcc3bd9d169e5bd9f41e4b85cf45565d851f (diff) | |
display newest members and top contributers in artists drop down.
Diffstat (limited to 'app/controllers/application_controller.rb')
| -rw-r--r-- | app/controllers/application_controller.rb | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/app/controllers/application_controller.rb b/app/controllers/application_controller.rb index 5a0ad6bb..35279572 100644 --- a/app/controllers/application_controller.rb +++ b/app/controllers/application_controller.rb @@ -4,6 +4,7 @@ class ApplicationController < ActionController::Base protect_from_forgery with: :exception before_filter :load_categories before_filter :load_tutorials + before_filter :load_users before_filter :load_user before_filter :configure_permitted_parameters, if: :devise_controller? @@ -21,6 +22,11 @@ class ApplicationController < ActionController::Base @newest_tutorials = Tutorial.order(:created_at => :desc).limit(3) end + def load_users + @newest_members = User.order(:created_at => :desc).limit(3) + @top_members = User.order(:creations_count => :desc).limit(3) + end + def load_user @user = current_user if current_user end |
