Fix routing. Finalize user show page

This commit is contained in:
Dmitriy Zaporozhets 2013-01-22 19:45:13 +02:00
parent 70690e1971
commit 96d97c4857
5 changed files with 31 additions and 14 deletions

View file

@ -1,6 +1,6 @@
class UsersController < ApplicationController
def show
@user = User.find_by_username(params[:username])
@user = User.find_by_username!(params[:username])
@projects = @user.authorized_projects.where('projects.id in (?)', current_user.authorized_projects.map(&:id))
@events = @user.recent_events.where(project_id: @projects.map(&:id)).limit(20)
end