I tried to follow this screencast by Michael Snoyman http://vimeo.com/39646807. However, it seems changes to the i18n causes that code to fail. I can't find any information on how to solve this problem on a scaffolded site and I can't quite make sense of the information given here http://www.yesodweb.com/book/internationalization.
This is the error i get, referring to code in Home.hs:
No instance for (RenderMessage master0 FormMessage)
arising from a use of `generateFormPost'
Possible fix:
add an instance declaration for (RenderMessage master0 FormMessage)
In a stmt of a 'do' block:
(formWidget, enctype) <- generateFormPost noteForm
In the expression:
do { (formWidget, enctype) <- generateFormPost noteForm;
defaultLayout ($(widgetFile "notes")) }
In an equation for `getNotesR':
getNotesR
= do { (formWidget, enctype) <- generateFormPost noteForm;
defaultLayout ($(widgetFile "notes")) }
The information seems pretty clear, the problem is I can't figure out how to add an instance declaration for (RenderMessage master0 FormMessage).
Here's the code I added to Home.hs
noteForm = renderBootstrap $ Note
<$> areq textField "Title" Nothing
<*> areq textField "Content" Nothing
getNotesR = do
(formWidget, enctype) <- generateFormPost noteForm
defaultLayout $(widgetFile "notes")
postNotesR = return ()
getNoteR noteId = return ()
Ant the following is from templates/notes.hamlet
<form method=post enctype=#{enctype}>
^{formWidget}
<input type=submit>