diff options
-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 |