进入其他人个人主页时,点击他创建的课程报错

This commit is contained in:
sw 2015-07-29 15:55:23 +08:00
parent 9c704b7dc1
commit a667d97768
1 changed files with 6 additions and 8 deletions

View File

@ -120,9 +120,9 @@ class UsersController < ApplicationController
end
projects = @user.projects.visible.order("updated_on desc")
if(params[:status] == '1')
projects = projects.where("user_id = ?",@user.id)
projects = projects.where("projects.user_id = ?",@user.id)
elsif(params[:status] == '2')
projects = projects.where("user_id <> ?",@user.id)
projects = projects.where("projects.user_id <> ?",@user.id)
end
@list = paginateHelper projects,10
@params = params[:status]
@ -261,17 +261,15 @@ class UsersController < ApplicationController
# modified by fq
def user_newfeedback
@jours = @user.journals_for_messages.where('m_parent_id IS NULL').order('created_on DESC')
@jours.update_all(:is_readed => true, :status => false)
@jours.each do |journal|
jours = @user.journals_for_messages.where('m_parent_id IS NULL').order('created_on DESC')
jours.update_all(:is_readed => true, :status => false)
jours.each do |journal|
fetch_user_leaveWord_reply(journal).update_all(:is_readed => true, :status => false)
end
@jour = paginateHelper @jours,10
@jour = paginateHelper jours,10
@state = false
render :layout=>'base_users_new'
end
# end
def user_comments