С yesod-0.10.1
Определение:
postBlogR :: Handler RepHtml
postBlogR = do
((res, articleWidget), enctype) <- runFormPost entryForm
case res of
FormSuccess article -> do
articleId <- runDB $ insert article
setMessage $ toHtml $ (articleTitle article) <> " created"
redirect $ ArticleR articleId
_ -> defaultLayout $ do
setTitle "Please correct your entry form"
$(widgetFile "articleAddError")
База данных
Article
title Text
content Html
deriving
Я получу \x48656c6c6f2c20776f726c6421
в базе данных, если я отправлю Hello, world!