Topic: trouble sorting comments

I'm trying to figure out how to sort comments.

videos_helper.rb

module VideosHelper
  def render_comments_for(video)
    render :partial => (video.video_comments.sort_by_id { |vc| vc.user.is_judge? ? 0 : 1})
  end
end

video.rb
  def comments
    video_comments
  end

video.rb

  def response_for_show
    format.html {
      # if they are viewing a non-existant video... just send them to the
      # home page
      if current_object == nil
        redirect_to "/"
      else
        session[:intended_path] = request.path
        VideoView.create(:ip => request.remote_ip, :video_id => @video.id)
        if request.path =~ /^\/videos/
          redirect_to show_video_url(@video)
        end
      end
    }
  end

video_comment.rb
class VideoComment < ActiveRecord::Base
  belongs_to :video
  belongs_to :user

  validates_presence_of :body, :name #, :user_id

  def name
    user.name
  rescue
    attributes[:name]
  end
end


_video_comment.haml
%li{:class => "video_comment" + (video_comment.user.is_judge? ? " judge" : "")}[video_comment]
  %cite
    %strong
      - if video_comment.user.photo
        = image_tag video_comment.user.photo.s3_url(:tiny), :height => 20, :width => 20
      = link_to video_comment.name, user_url(:id => video_comment.user)
    said...
    - if current_user && current_user.is_admin?
      %small= link_to_remote "(delete)", :url => video_comment_url(@video, video_comment), :method => :delete, :confirm => "Are you sure you want to delete this comment?"
  #comment_box
    = markdown(video_comment.body)d

The problem is I need to display on top if its a judges comment and sort the other comments after that based upon newest first and 50 at a time.

I have looked this up a lot, but with our completely rewriting the code. Does  anyone have an idea?

Thanks,
Jonathan

Visit Project Breakout for your breakout opportunity in Music, Comedy and Film