Created
April 23, 2014 04:46
-
-
Save chukitow/11202981 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
| @picture = params[:picture] #form data | |
| directory = "photos" #path destination | |
| path = File.join(directory,@picture.original_filename) #join the name "pathdestination/filename.extension" | |
| File.open(path, "wb") { |f| f.write(@picture.read) } #save the file | |
| redirect_to root_path |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment