Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Merge pull request #11910 from brendon/master

Use binary mode to write uploaded files [ci skip]
  • Loading branch information...
commit 5297b48df0d4b4136f0d74bf2dc0a3153d7cf31b 2 parents 5c6e11d + 92a03d8
@carlosantoniodasilva carlosantoniodasilva authored
Showing with 1 addition and 1 deletion.
  1. +1 −1  guides/source/form_helpers.md
View
2  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
Please sign in to comment.
Something went wrong with that request. Please try again.