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:
parent
0a6b866ff2
commit
cc9010a33d
1 changed files with 5 additions and 1 deletions
|
@ -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.
|
||||||
|
|
Loading…
Reference in a new issue