Skip to content

Commit

Permalink
updating form guides to include mention of multipart option. Fixes #336
Browse files Browse the repository at this point in the history
… (#528)
  • Loading branch information
jwoertink authored Dec 21, 2020
1 parent f6c9a7a commit fa59a50
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions src/actions/guides/frontend/html_forms.cr
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,16 @@ class Guides::Frontend::HtmlForms < GuideAction
end
```
### Multipart forms
When doing file-uploads, you'll need to set the `multipart` option to `true`. This will add `enctype="multipart/form-data"` to your form.
```crystal
form_for(Users::Update.with(id: current_user.id), multipart: true) do
file_input(operation.avatar)
end
```
### Custom forms
If you need more control over how your form is displayed, you can always use the `form`
Expand Down Expand Up @@ -140,6 +150,8 @@ class Guides::Frontend::HtmlForms < GuideAction
required />
```
> Be sure to set `multipart: true` on your `form_for`
### color input
```crystal
Expand Down

0 comments on commit fa59a50

Please sign in to comment.