Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Merge pull request #1 from pSub/master

Updated for Yesod 1.0
  • Loading branch information...
commit 96b0a9c099e376367f0e1b23e08aca059221ce39 2 parents 58524bb + 00ed1da
@pbrisbin authored
Showing with 8 additions and 6 deletions.
  1. +2 −0  .gitignore
  2. +5 −3 minimal-forms.hs
  3. +1 −3 minimal.hs
View
2  .gitignore
@@ -1 +1,3 @@
*.aes
+*.hi
+*.o
View
8 minimal-forms.hs
@@ -18,8 +18,7 @@ mkYesod "Minimal" [parseRoutes|
type Form x = Html -> MForm Minimal Minimal (FormResult x, Widget)
-instance Yesod Minimal where
- approot _ = ""
+instance Yesod Minimal where
defaultLayout widget = do
pc <- widgetToPageContent widget
hamletToRepHtml [hamlet|
@@ -55,7 +54,10 @@ theForm = renderDivs $ TheForm
where
selectFruit :: Field Minimal Minimal Fruit
- selectFruit = selectField [("apple", Apple), ("orange", Orange), ("pear", Pear)]
+ selectFruit = selectField $ return $ mkOptionList [ Option "Apple" Apple "apple"
+ , Option "Orange" Orange "orange"
+ , Option "Pear" Pear "pear"
+ ]
getRootR :: Handler RepHtml
getRootR = do
View
4 minimal.hs
@@ -14,8 +14,7 @@ mkYesod "Minimal" [parseRoutes|
/ RootR GET
|]
-instance Yesod Minimal where
- approot _ = ""
+instance Yesod Minimal where
defaultLayout widget = do
pc <- widgetToPageContent widget
hamletToRepHtml [hamlet|
@@ -35,7 +34,6 @@ instance Yesod Minimal where
getRootR :: Handler RepHtml
getRootR = defaultLayout $ do
setTitle "My title"
-
[whamlet|<p>Hello world|]
main :: IO ()
Please sign in to comment.
Something went wrong with that request. Please try again.