diff options
author | Carlos Antonio da Silva <carlosantoniodasilva@gmail.com> | 2013-08-16 05:12:20 -0700 |
---|---|---|
committer | Carlos Antonio da Silva <carlosantoniodasilva@gmail.com> | 2013-08-16 05:12:20 -0700 |
commit | 5297b48df0d4b4136f0d74bf2dc0a3153d7cf31b (patch) | |
tree | e8172211570c4ab404d2477fc06a3315e011973c /guides/source | |
parent | 5c6e11d6b89444eefcb12e24d5419dadefdea1ba (diff) | |
parent | 92a03d888e0053962061fdfb1139c91e086bff0e (diff) | |
download | rails-5297b48df0d4b4136f0d74bf2dc0a3153d7cf31b.tar.gz rails-5297b48df0d4b4136f0d74bf2dc0a3153d7cf31b.tar.bz2 rails-5297b48df0d4b4136f0d74bf2dc0a3153d7cf31b.zip |
Merge pull request #11910 from brendon/master
Use binary mode to write uploaded files [ci skip]
Diffstat (limited to 'guides/source')
-rw-r--r-- | guides/source/form_helpers.md | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/guides/source/form_helpers.md b/guides/source/form_helpers.md index 11e8db9e88..3a18fb81d8 100644 --- a/guides/source/form_helpers.md +++ b/guides/source/form_helpers.md @@ -605,7 +605,7 @@ The object in the `params` hash is an instance of a subclass of IO. Depending on ```ruby def upload uploaded_io = params[:person][:picture] - File.open(Rails.root.join('public', 'uploads', uploaded_io.original_filename), 'w') do |file| + File.open(Rails.root.join('public', 'uploads', uploaded_io.original_filename), 'wb') do |file| file.write(uploaded_io.read) end end |