Closed dubiousdavid closed 12 years ago
The following fixes the issue and removes the duplicate css inclusion.
site :: Happstack.ServerPart Happstack.Response
site = do
Happstack.decodeBody $ Happstack.defaultBodyPolicy "/tmp" 4096 4096 4096
r <- runForm "test" releaseForm
case r of
(view, Nothing) -> do
let view' = fmap H.toHtml view
Happstack.ok $ Happstack.toResponse $
template $ do
form view' "/" $ do
releaseView view'
H.br
inputSubmit "Submit"
(_, Just release) -> Happstack.ok $ Happstack.toResponse $
template $ do
css
H.h1 "Release received"
H.p $ H.toHtml $ show release
Thanks for the patch! Feel free to file a pull request next time, so you get proper credit.
The form element is not embedded within the body element. The rendered output is: