Re: [web-devel] [Yesod] Abstracting permissions with Yesod

On Sun, Sep 9, 2012 at 2:15 PM, Arthur Clemens
/admin AdminR: /product/#ProductId AdminProductR GET POST ...
So if I have:
/admin AdminR: / AdminRootR GET /categories AdminCategoriesR GET
and the handlers are specified as:
getAdminRootR :: Handler RepHtml getAdminRootR = do ..
getAdminCategoriesR :: Handler RepHtml getAdminCategoriesR = do ..
what more is needed to create links? Currently I use <a href=@{AdminRootR}> but that results in
Handler/Admin.hs:14:22: Not in scope: data constructor `AdminRootR'
Arthur
You'll need the AdminR constructor: AdminR AdminRootR. If you use -ddump-splices when compiling, GHC will spit out the generated code/data types, which should give a good idea of what's going on under the surface. Michael
participants (1)
-
Michael Snoyman