2012-03-20 12 views
1

'バイト' でイェソド-0.10.1ストアのHTMLタイプ

定義を持つ:

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 

私はHello, world!

を投稿する場合、私は、データベース内 \x48656c6c6f2c20776f726c6421を取得します
+3

!この問題は表現上の問題にすぎません。 BLOB – njzk2

答えて

1

この問題はメーリングリストで発生しました(同じ人ですか?)とにかく、答えはここにある:こんにちは、世界を意味バイトの表現がある

https://groups.google.com/d/topic/yesodweb/VMGqhS1QAsk/discussion

+1

として、* chenwl *の "wl"が* wenlong *の略であると信じているように、htmlをTEXTとして保存したいと思うでしょう。私はまた、ここのマイケルスノーマンは同じマイケルスノーマンであると信じています;) – vol7ron

+0

@ vol7ron、あなたは正しいです。 :-) – wenlong