chenwl
unread,Mar 20, 2012, 10:32:59 AM3/20/12Sign in to reply to author
Sign in to forward
You do not have permission to delete messages in this group
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to Yesod Web Framework
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!
Also it present as '\x48656c6c6f2c20776f726c6421' in web page.
I've tried mongodb and sqlite, both works as expect. Postgresql is
strange.