- def hidecomment
- comment = DiaryComment.find(params[:comment])
- comment.update(:visible => false)
- redirect_to diary_entry_path(comment.diary_entry.user, comment.diary_entry)
- end
-
- def unhidecomment
- comment = DiaryComment.find(params[:comment])
- comment.update(:visible => true)
- redirect_to diary_entry_path(comment.diary_entry.user, comment.diary_entry)
- end
-
- def comments
- @title = t ".title", :user => @user.display_name
-
- comments = DiaryComment.where(:user => @user)
- comments = comments.visible unless can? :unhidecomment, DiaryEntry
-
- @params = params.permit(:display_name, :before, :after)
-
- @comments, @newer_comments_id, @older_comments_id = get_page_items(comments, [:user])
- end
-