1
0
Fork 0
mirror of https://github.com/rails/rails.git synced 2022-11-09 12:12:34 -05:00

Active Storage: Explicit form field in basic example

Also fix syntax highlighting in the more advanced JS example.
This commit is contained in:
Henrik Nyh 2018-06-22 21:55:06 +01:00 committed by GitHub
parent 0a6b866ff2
commit cc9010a33d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -230,6 +230,10 @@ end
You can create a user with an avatar: You can create a user with an avatar:
```erb
<%= form.file_field :avatar %>
```
```ruby ```ruby
class SignupController < ApplicationController class SignupController < ApplicationController
def create def create
@ -479,7 +483,7 @@ directly from the client to the cloud.
2. Annotate file inputs with the direct upload URL. 2. Annotate file inputs with the direct upload URL.
```ruby ```erb
<%= form.file_field :attachments, multiple: true, direct_upload: true %> <%= form.file_field :attachments, multiple: true, direct_upload: true %>
``` ```
3. That's it! Uploads begin upon form submission. 3. That's it! Uploads begin upon form submission.