mirror of
https://github.com/publiclab/mapknitter.git
synced 2026-01-11 09:55:29 +01:00
* initial cleanup * export unit tests, basic * map tests * basic comment tests * cleanup * export functional tests * fixes * Update export.rb * test fixes and further cleanup * extra test * trying again * another unit test * output errors? * Update map_test.rb * Update maps.yml * Update tag_test.rb
21 lines
570 B
Ruby
21 lines
570 B
Ruby
class UsersController < ApplicationController
|
|
|
|
def profile
|
|
params[:id] = current_user.login if logged_in? && params[:id] == 0
|
|
@user = User.find_by_login(params[:id])
|
|
@maps = Map.where(user_id: @user.id)
|
|
.paginate(:page => params[:page], :per_page => 24)
|
|
end
|
|
|
|
def index
|
|
@title = "Prolific map authors"
|
|
@users = User.joins(:maps)
|
|
.select("users.*, count(users.id) as maps_count")
|
|
.group("maps.user_id")
|
|
.order("maps_count DESC")
|
|
.paginate(:page => params[:page], :per_page => 24)
|
|
render "users/index"
|
|
end
|
|
|
|
end
|