Skip to content

Instantly share code, notes, and snippets.

@anlek
Forked from kracekumar/upload_controller.rb
Created March 22, 2011 01:05
Show Gist options
  • Save anlek/880570 to your computer and use it in GitHub Desktop.
Save anlek/880570 to your computer and use it in GitHub Desktop.
class UploadController < ApplicationController
def admission
@all=Upload.all
params[:upload]['item'] += "_#{Time.now.to_i}" if params[:upload]['item'].present?
#doing Time.now.to_i will give you better results for filenames then to_s
@upload=Upload.new(params[:upload])
#@upload.uploaded_at = Time.now #This should happen automagically though
if @upload.save
flash[:notice]="File uploaded successful,please wait for processing "
else
flash[:notice]="SOmething went wrong "
end
end
def marks
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment