mirror of
https://github.com/rails/rails.git
synced 2022-11-09 12:12:34 -05:00
code quotes for classname
This commit is contained in:
parent
10db166aef
commit
52f430f6cc
1 changed files with 1 additions and 1 deletions
|
@ -623,7 +623,7 @@ Rails provides the usual pair of helpers: the barebones `file_field_tag` and the
|
||||||
|
|
||||||
### What Gets Uploaded
|
### What Gets Uploaded
|
||||||
|
|
||||||
The object in the `params` hash is an instance of a subclass of `IO`. Depending on the size of the uploaded file it may in fact be a StringIO or an instance of `File` backed by a temporary file. In both cases the object will have an `original_filename` attribute containing the name the file had on the user's computer and a `content_type` attribute containing the MIME type of the uploaded file. The following snippet saves the uploaded content in `#{Rails.root}/public/uploads` under the same name as the original file (assuming the form was the one in the previous example).
|
The object in the `params` hash is an instance of a subclass of `IO`. Depending on the size of the uploaded file it may in fact be a `StringIO` or an instance of `File` backed by a temporary file. In both cases the object will have an `original_filename` attribute containing the name the file had on the user's computer and a `content_type` attribute containing the MIME type of the uploaded file. The following snippet saves the uploaded content in `#{Rails.root}/public/uploads` under the same name as the original file (assuming the form was the one in the previous example).
|
||||||
|
|
||||||
```ruby
|
```ruby
|
||||||
def upload
|
def upload
|
||||||
|
|
Loading…
Reference in a new issue