class DownloadController < ApplicationController
  def index
    @file_types =  Download.select(:file_type).collect{|t|t.file_type}.uniq
  end

  def download
    @download = Download.find params[:id]
    if File.exist?(@download.file_path)
      send_file(@download.file_path)
    else
      render :nothing => true, :status => 404
    end
  end
end
