With yesod-0.10.1
Definition:
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")
Database
Article
title Text
content Html
deriving
I get \x48656c6c6f2c20776f726c6421 in database if I post Hello, world!
This issue came up on the mailing list (is the question coming from the same person?). Anyway, the answer is here:
https://groups.google.com/d/topic/yesodweb/VMGqhS1QAsk/discussion