Skip to content

Instantly share code, notes, and snippets.

@faust45
Created April 6, 2010 09:05
Show Gist options
  • Select an option

  • Save faust45/357381 to your computer and use it in GitHub Desktop.

Select an option

Save faust45/357381 to your computer and use it in GitHub Desktop.
def create
attach = params[:video].delete(:file)
@video = Video.new(params[:video])
if @video.save
@video.put_attachment('clip', attach.read)
flash[:notice] = 'Video created succes!'
redirect_to admin_videos_path
else
flash[:notice] = 'Video created is fail!'
render :action => :new
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment