2
実行時にハムレットテンプレート内のルートにパラメータを渡そうとしています。Yesod:パラメータ化されたルートを構築する方法
buildFeedRow :: Item [Attribute Text] -> GWidget a a()
buildFeedRow item = do
let f = unpackItem item
u :: Text = url f
[whamlet|
<tr>
<td>
<a href="#{url f}">#{url f}
<td>#{nextCrawlTime f}
<td>#{crawlDelay f}
<td>
<a href="@{DeleteFeedR u}">Delete
<td>Edit |]
タイプエラーで失敗します。
Couldn't match type `Route a' with `ConsoleRoute'
Expected type: ConsoleRoute -> [(Text, Text)] -> Text
Actual type: Route a -> [(Text, Text)] -> Text
Expected type: GHandler
a a (ConsoleRoute -> [(Text, Text)] -> Text)
Actual type: GGHandler
a
a
(Data.Enumerator.Iteratee Data.ByteString.Internal.ByteString IO)
(Route a -> [(Text, Text)] -> Text)
In the first argument of `lift', namely `getUrlRenderParams'
In the first argument of `(>>=)', namely `lift getUrlRenderParams'
私の質問は、どのようにハムレットテンプレートのルートにパラメータを渡すのですか。
を持っている必要がありますので、それは今あなたの基盤の種類に依存し、私は何か他のものはここに遊びにあります推測しています。たぶんいくつかのタイプシグネチャを追加するか、スニペットに周囲のコードを追加することをお勧めします。 –