Skip to content

Commit

Permalink
Merge pull request #449 from Montmorency/recipe-picture-url
Browse files Browse the repository at this point in the history
updated picture upload docs to handle null cases.
  • Loading branch information
mpscholten authored Oct 6, 2020
2 parents 2d68c41 + 76b5cd9 commit 5f7bb7b
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions Guide/recipes.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,11 @@ action UpdateUserAction { userId } = do
This accepts any kind of image file compatible with imagemagick, resize it, reduce the image quality, strip all meta information and save it as jpg. The file is stored inside the `static/uploads` folder in the project (directory will be created if it does not exist).

In your view, just use the image url like `<img src={get #pictureUrl currentUser}/>`.
Note that when you define the `picture_url` field in your `users` table that you
must check the `Nullable` select box with a default `Null`. This ensures your
`pictureUrl` data has a `Maybe Text` type and can handle
cases where the user has not uploaded any image.


There is currently no special form helper for file uploads. Just specificy it manually like this:

Expand Down

0 comments on commit 5f7bb7b

Please sign in to comment.