-
-
Save anlek/880570 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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